website/docs: note docker behavior in file provisioner

This commit is contained in:
Matthew Hooker 2017-03-09 16:30:51 -08:00
parent 9de7e65b73
commit e63a646afe
No known key found for this signature in database
GPG Key ID: 7B5F933D9CE8C6A1
1 changed files with 18 additions and 16 deletions

View File

@ -54,7 +54,9 @@ know.
First, the destination directory must already exist. If you need to create it, First, the destination directory must already exist. If you need to create it,
use a shell provisioner just prior to the file provisioner in order to create use a shell provisioner just prior to the file provisioner in order to create
the directory. the directory. Note that the `docker` builder does not have this requirement.
It will create any needed destination directories, but it's generally best
practice to not rely on this behavior.
Next, the existence of a trailing slash on the source path will determine Next, the existence of a trailing slash on the source path will determine
whether the directory name will be embedded within the destination, or whether whether the directory name will be embedded within the destination, or whether
@ -91,20 +93,20 @@ lrwxr-xr-x 1 mwhooker staff 5 Jan 27 17:10 file1link -> file1
```json ```json
"provisioners": [ "provisioners": [
{ {
"type": "shell-local", "type": "shell-local",
"command": "mkdir -p toupload; tar cf toupload/files.tar files" "command": "mkdir -p toupload; tar cf toupload/files.tar files"
}, },
{ {
"destination": "/tmp/", "destination": "/tmp/",
"source": "./toupload", "source": "./toupload",
"type": "file" "type": "file"
}, },
{ {
"inline": [ "inline": [
"cd /tmp && tar xf toupload/files.tar", "cd /tmp && tar xf toupload/files.tar",
], ],
"type": "shell" "type": "shell"
} }
] ]
``` ```