Packer Docker builder 在 Windows 10 上使用 chmod
Packer Docker builder using chmod on Windows 10
这是我的打包文件:
{
"builders": [{
"type": "docker",
"image": "ubuntu",
"export_path": "image.tar"
}],
"provisioners": [{
"type": "shell",
"inline": ["mkdir /full_install",
"mkdir /scripts"]
},
{
"type": "file",
"source": "./scripts/",
"destination": "/scripts"
}]
}
简单。尝试只创建 2 个目录,然后将一些脚本上传到其中一个目录。我在 Windows 10:
上得到以下输出
C:\Work\Packer\myPacker>packer build myServer.json
docker output will be in this color.
==> docker: Creating a temporary directory for sharing data...
==> docker: Pulling Docker image: ubuntu
docker: Using default tag: latest
docker: latest: Pulling from library/ubuntu
docker: Digest: sha256:dd7808d8792c9841d0b460122f1acf0a2dd1f56404f8d1e56298048885e45535
docker: Status: Image is up to date for ubuntu:latest
==> docker: Starting docker container...
docker: Run command: docker run -v C:\Users\syarnell\AppData\Roaming\packer.d\tmp\packer-docker346952011:/packer-files -d -i -t ubuntu /bin/bash
docker: Container ID: 84a0969874bbfc031f60ad03c8e6765f895733cdfd51c727ae59c82a80c82658
==> docker: Provisioning with shell script: C:\Users\syarnell\AppData\Local\Temp\packer-shell141617915
==> docker: Uploading ./scripts/ => /scripts
==> docker: Killing the container: 84a0969874bbfc031f60ad03c8e6765f895733cdfd51c727ae59c82a80c82658
Build 'docker' errored: chmod C:\Users\syarnell\AppData\Roaming\packer.d\tmp\packer-docker346952011\dirupload432828853\batchInstall.sh: not supported by windows
==> Some builds didn't complete successfully and had errors:
--> docker: chmod C:\Users\syarnell\AppData\Roaming\packer.d\tmp\packer-docker346952011\dirupload432828853\batchInstall.sh: not supported by windows
==> Builds finished but no artifacts were created.
C:\Work\Packer\myPacker>
为什么要对 Windows 10 中的文件进行 chmod?
Packer Docker 生成器无法在 Windows 上运行,在 github.com 上打开一个问题。
这是我的打包文件:
{
"builders": [{
"type": "docker",
"image": "ubuntu",
"export_path": "image.tar"
}],
"provisioners": [{
"type": "shell",
"inline": ["mkdir /full_install",
"mkdir /scripts"]
},
{
"type": "file",
"source": "./scripts/",
"destination": "/scripts"
}]
}
简单。尝试只创建 2 个目录,然后将一些脚本上传到其中一个目录。我在 Windows 10:
上得到以下输出C:\Work\Packer\myPacker>packer build myServer.json docker output will be in this color.
==> docker: Creating a temporary directory for sharing data... ==> docker: Pulling Docker image: ubuntu docker: Using default tag: latest docker: latest: Pulling from library/ubuntu docker: Digest: sha256:dd7808d8792c9841d0b460122f1acf0a2dd1f56404f8d1e56298048885e45535 docker: Status: Image is up to date for ubuntu:latest ==> docker: Starting docker container... docker: Run command: docker run -v C:\Users\syarnell\AppData\Roaming\packer.d\tmp\packer-docker346952011:/packer-files -d -i -t ubuntu /bin/bash docker: Container ID: 84a0969874bbfc031f60ad03c8e6765f895733cdfd51c727ae59c82a80c82658 ==> docker: Provisioning with shell script: C:\Users\syarnell\AppData\Local\Temp\packer-shell141617915 ==> docker: Uploading ./scripts/ => /scripts ==> docker: Killing the container: 84a0969874bbfc031f60ad03c8e6765f895733cdfd51c727ae59c82a80c82658 Build 'docker' errored: chmod C:\Users\syarnell\AppData\Roaming\packer.d\tmp\packer-docker346952011\dirupload432828853\batchInstall.sh: not supported by windows
==> Some builds didn't complete successfully and had errors: --> docker: chmod C:\Users\syarnell\AppData\Roaming\packer.d\tmp\packer-docker346952011\dirupload432828853\batchInstall.sh: not supported by windows
==> Builds finished but no artifacts were created.
C:\Work\Packer\myPacker>
为什么要对 Windows 10 中的文件进行 chmod?
Packer Docker 生成器无法在 Windows 上运行,在 github.com 上打开一个问题。