Skip to content

Instantly share code, notes, and snippets.

@bertramn
Created April 10, 2019 07:29
Show Gist options
  • Star 0 You must be signed in to star a gist
  • Fork 0 You must be signed in to fork a gist
  • Save bertramn/672485dd92719fae7ed66d20b2f2858e to your computer and use it in GitHub Desktop.
Save bertramn/672485dd92719fae7ed66d20b2f2858e to your computer and use it in GitHub Desktop.
Packer Log not setting ENTRYPOINT in docker build
2019/04/10 17:16:01 [INFO] Packer version: 1.3.5
2019/04/10 17:16:01 Packer Target OS/Arch: darwin amd64
2019/04/10 17:16:01 Built with Go Version: go1.12
2019/04/10 17:16:01 Detected home directory from env var: /Users/fred
2019/04/10 17:16:01 Using internal plugin for oneandone
2019/04/10 17:16:01 Using internal plugin for virtualbox-iso
2019/04/10 17:16:01 Using internal plugin for digitalocean
2019/04/10 17:16:01 Using internal plugin for file
2019/04/10 17:16:01 Using internal plugin for azure-arm
2019/04/10 17:16:01 Using internal plugin for googlecompute
2019/04/10 17:16:01 Using internal plugin for lxd
2019/04/10 17:16:01 Using internal plugin for triton
2019/04/10 17:16:01 Using internal plugin for amazon-chroot
2019/04/10 17:16:01 Using internal plugin for amazon-ebs
2019/04/10 17:16:01 Using internal plugin for hyperv-vmcx
2019/04/10 17:16:01 Using internal plugin for lxc
2019/04/10 17:16:01 Using internal plugin for amazon-ebsvolume
2019/04/10 17:16:01 Using internal plugin for amazon-instance
2019/04/10 17:16:01 Using internal plugin for null
2019/04/10 17:16:01 Using internal plugin for parallels-pvm
2019/04/10 17:16:01 Using internal plugin for vagrant
2019/04/10 17:16:01 Using internal plugin for vmware-vmx
2019/04/10 17:16:01 Using internal plugin for amazon-ebssurrogate
2019/04/10 17:16:01 Using internal plugin for ncloud
2019/04/10 17:16:01 Using internal plugin for alicloud-ecs
2019/04/10 17:16:01 Using internal plugin for scaleway
2019/04/10 17:16:01 Using internal plugin for qemu
2019/04/10 17:16:01 Using internal plugin for tencentcloud-cvm
2019/04/10 17:16:01 Using internal plugin for vmware-iso
2019/04/10 17:16:01 Using internal plugin for hyperone
2019/04/10 17:16:01 Using internal plugin for openstack
2019/04/10 17:16:01 Using internal plugin for virtualbox-ovf
2019/04/10 17:16:01 Using internal plugin for docker
2019/04/10 17:16:01 Using internal plugin for profitbricks
2019/04/10 17:16:01 Using internal plugin for hyperv-iso
2019/04/10 17:16:01 Using internal plugin for oracle-classic
2019/04/10 17:16:01 Using internal plugin for oracle-oci
2019/04/10 17:16:01 Using internal plugin for parallels-iso
2019/04/10 17:16:01 Using internal plugin for cloudstack
2019/04/10 17:16:01 Using internal plugin for hcloud
2019/04/10 17:16:01 Using internal plugin for breakpoint
2019/04/10 17:16:01 Using internal plugin for file
2019/04/10 17:16:01 Using internal plugin for inspec
2019/04/10 17:16:01 Using internal plugin for puppet-server
2019/04/10 17:16:01 Using internal plugin for ansible
2019/04/10 17:16:01 Using internal plugin for ansible-local
2019/04/10 17:16:01 Using internal plugin for puppet-masterless
2019/04/10 17:16:01 Using internal plugin for windows-shell
2019/04/10 17:16:01 Using internal plugin for chef-solo
2019/04/10 17:16:01 Using internal plugin for converge
2019/04/10 17:16:01 Using internal plugin for powershell
2019/04/10 17:16:01 Using internal plugin for shell
2019/04/10 17:16:01 Using internal plugin for shell-local
2019/04/10 17:16:01 Using internal plugin for chef-client
2019/04/10 17:16:01 Using internal plugin for salt-masterless
2019/04/10 17:16:01 Using internal plugin for windows-restart
2019/04/10 17:16:01 Using internal plugin for amazon-import
2019/04/10 17:16:01 Using internal plugin for artifice
2019/04/10 17:16:01 Using internal plugin for manifest
2019/04/10 17:16:01 Using internal plugin for alicloud-import
2019/04/10 17:16:01 Using internal plugin for docker-tag
2019/04/10 17:16:01 Using internal plugin for shell-local
2019/04/10 17:16:01 Using internal plugin for docker-import
2019/04/10 17:16:01 Using internal plugin for docker-save
2019/04/10 17:16:01 Using internal plugin for googlecompute-import
2019/04/10 17:16:01 Using internal plugin for vagrant-cloud
2019/04/10 17:16:01 Using internal plugin for googlecompute-export
2019/04/10 17:16:01 Using internal plugin for vagrant
2019/04/10 17:16:01 Using internal plugin for vsphere
2019/04/10 17:16:01 Using internal plugin for vsphere-template
2019/04/10 17:16:01 Using internal plugin for checksum
2019/04/10 17:16:01 Using internal plugin for compress
2019/04/10 17:16:01 Using internal plugin for digitalocean-import
2019/04/10 17:16:01 Using internal plugin for docker-push
2019/04/10 17:16:01 Detected home directory from env var: /Users/fred
2019/04/10 17:16:01 Attempting to open config file: /Users/fred/.packerconfig
2019/04/10 17:16:01 [WARN] Config file doesn't exist: /Users/fred/.packerconfig
2019/04/10 17:16:01 Packer config: &{DisableCheckpoint:false DisableCheckpointSignature:false PluginMinPort:10000 PluginMaxPort:25000 Builders:map[alicloud-ecs:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-alicloud-ecs amazon-chroot:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-amazon-chroot amazon-ebs:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-amazon-ebs amazon-ebssurrogate:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-amazon-ebssurrogate amazon-ebsvolume:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-amazon-ebsvolume amazon-instance:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-amazon-instance azure-arm:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-azure-arm cloudstack:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-cloudstack digitalocean:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-digitalocean docker:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-docker file:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-file googlecompute:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-googlecompute hcloud:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-hcloud hyperone:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-hyperone hyperv-iso:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-hyperv-iso hyperv-vmcx:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-hyperv-vmcx lxc:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-lxc lxd:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-lxd ncloud:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-ncloud null:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-null oneandone:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-oneandone openstack:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-openstack oracle-classic:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-oracle-classic oracle-oci:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-oracle-oci parallels-iso:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-parallels-iso parallels-pvm:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-parallels-pvm profitbricks:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-profitbricks qemu:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-qemu scaleway:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-scaleway tencentcloud-cvm:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-tencentcloud-cvm triton:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-triton vagrant:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-vagrant virtualbox-iso:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-virtualbox-iso virtualbox-ovf:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-virtualbox-ovf vmware-iso:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-vmware-iso vmware-vmx:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-builder-vmware-vmx] PostProcessors:map[alicloud-import:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-alicloud-import amazon-import:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-amazon-import artifice:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-artifice checksum:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-checksum compress:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-compress digitalocean-import:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-digitalocean-import docker-import:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-docker-import docker-push:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-docker-push docker-save:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-docker-save docker-tag:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-docker-tag googlecompute-export:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-googlecompute-export googlecompute-import:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-googlecompute-import manifest:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-manifest shell-local:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-shell-local vagrant:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-vagrant vagrant-cloud:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-vagrant-cloud vsphere:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-vsphere vsphere-template:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-post-processor-vsphere-template] Provisioners:map[ansible:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-ansible ansible-local:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-ansible-local breakpoint:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-breakpoint chef-client:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-chef-client chef-solo:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-chef-solo converge:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-converge file:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-file inspec:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-inspec powershell:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-powershell puppet-masterless:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-puppet-masterless puppet-server:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-puppet-server salt-masterless:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-salt-masterless shell:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-shell shell-local:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-shell-local windows-restart:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-windows-restart windows-shell:/usr/local/bin/packer-PACKERSPACE-plugin-PACKERSPACE-packer-provisioner-windows-shell]}
2019/04/10 17:16:01 Detected home directory from env var: /Users/fred
2019/04/10 17:16:01 Setting cache directory: /Users/fred/workspaces/cloudops/packer-image-test/packer_cache
2019/04/10 17:16:01 Detected home directory from env var: /Users/fred
2019/04/10 17:16:01 Loading builder: docker
2019/04/10 17:16:01 Plugin could not be found. Checking same directory as executable.
2019/04/10 17:16:01 Current exe path: /usr/local/bin/packer
2019/04/10 17:16:01 Creating plugin client for path: /usr/local/bin/packer
2019/04/10 17:16:01 Starting plugin: /usr/local/bin/packer []string{"/usr/local/bin/packer", "plugin", "packer-builder-docker"}
2019/04/10 17:16:01 Waiting for RPC address for: /usr/local/bin/packer
2019/04/10 17:16:01 packer: 2019/04/10 17:16:01 [INFO] Packer version: 1.3.5
2019/04/10 17:16:01 packer: 2019/04/10 17:16:01 Packer Target OS/Arch: darwin amd64
2019/04/10 17:16:01 packer: 2019/04/10 17:16:01 Built with Go Version: go1.12
2019/04/10 17:16:01 packer: 2019/04/10 17:16:01 Detected home directory from env var: /Users/fred
2019/04/10 17:16:01 packer: 2019/04/10 17:16:01 Attempting to open config file: /Users/fred/.packerconfig
2019/04/10 17:16:01 packer: 2019/04/10 17:16:01 [WARN] Config file doesn't exist: /Users/fred/.packerconfig
2019/04/10 17:16:01 packer: 2019/04/10 17:16:01 Packer config: &{DisableCheckpoint:false DisableCheckpointSignature:false PluginMinPort:10000 PluginMaxPort:25000 Builders:map[] PostProcessors:map[] Provisioners:map[]}
2019/04/10 17:16:01 packer: 2019/04/10 17:16:01 Detected home directory from env var: /Users/fred
2019/04/10 17:16:01 packer: 2019/04/10 17:16:01 Setting cache directory: /Users/fred/workspaces/cloudops/packer-image-test/packer_cache
2019/04/10 17:16:01 packer: 2019/04/10 17:16:01 Detected home directory from env var: /Users/fred
2019/04/10 17:16:01 packer: 2019/04/10 17:16:01 args: []string{"packer-builder-docker"}
2019/04/10 17:16:01 packer: 2019/04/10 17:16:01 Plugin minimum port: 10000
2019/04/10 17:16:01 packer: 2019/04/10 17:16:01 Plugin maximum port: 25000
2019/04/10 17:16:01 packer: 2019/04/10 17:16:01 Plugin address: unix /var/folders/lg/55_gpx9527xcznrqlmg3qb4c0000gn/T/packer-plugin877612555
2019/04/10 17:16:01 packer: 2019/04/10 17:16:01 Waiting for connection...
2019/04/10 17:16:01 packer: 2019/04/10 17:16:01 Serving a plugin connection...
2019/04/10 17:16:01 Loading post-processor: docker-tag
2019/04/10 17:16:01 Plugin could not be found. Checking same directory as executable.
2019/04/10 17:16:01 Current exe path: /usr/local/bin/packer
2019/04/10 17:16:01 Creating plugin client for path: /usr/local/bin/packer
2019/04/10 17:16:01 Starting plugin: /usr/local/bin/packer []string{"/usr/local/bin/packer", "plugin", "packer-post-processor-docker-tag"}
2019/04/10 17:16:01 Waiting for RPC address for: /usr/local/bin/packer
2019/04/10 17:16:01 packer: 2019/04/10 17:16:01 [INFO] Packer version: 1.3.5
2019/04/10 17:16:01 packer: 2019/04/10 17:16:01 Packer Target OS/Arch: darwin amd64
2019/04/10 17:16:01 packer: 2019/04/10 17:16:01 Built with Go Version: go1.12
2019/04/10 17:16:01 packer: 2019/04/10 17:16:01 Detected home directory from env var: /Users/fred
2019/04/10 17:16:01 packer: 2019/04/10 17:16:01 Attempting to open config file: /Users/fred/.packerconfig
2019/04/10 17:16:01 packer: 2019/04/10 17:16:01 [WARN] Config file doesn't exist: /Users/fred/.packerconfig
2019/04/10 17:16:01 packer: 2019/04/10 17:16:01 Packer config: &{DisableCheckpoint:false DisableCheckpointSignature:false PluginMinPort:10000 PluginMaxPort:25000 Builders:map[] PostProcessors:map[] Provisioners:map[]}
2019/04/10 17:16:01 packer: 2019/04/10 17:16:01 Detected home directory from env var: /Users/fred
2019/04/10 17:16:01 packer: 2019/04/10 17:16:01 Setting cache directory: /Users/fred/workspaces/cloudops/packer-image-test/packer_cache
2019/04/10 17:16:01 packer: 2019/04/10 17:16:01 Detected home directory from env var: /Users/fred
2019/04/10 17:16:01 packer: 2019/04/10 17:16:01 args: []string{"packer-post-processor-docker-tag"}
2019/04/10 17:16:01 packer: 2019/04/10 17:16:01 Plugin minimum port: 10000
2019/04/10 17:16:01 packer: 2019/04/10 17:16:01 Plugin maximum port: 25000
2019/04/10 17:16:01 packer: 2019/04/10 17:16:01 Plugin address: unix /var/folders/lg/55_gpx9527xcznrqlmg3qb4c0000gn/T/packer-plugin611333663
2019/04/10 17:16:01 packer: 2019/04/10 17:16:01 Waiting for connection...
2019/04/10 17:16:01 packer: 2019/04/10 17:16:01 Serving a plugin connection...
2019/04/10 17:16:01 Build debug mode: false
2019/04/10 17:16:01 Force build: false
2019/04/10 17:16:01 On error:
2019/04/10 17:16:01 Preparing build: docker
docker output will be in this color.
2019/04/10 17:16:01 Waiting on builds to complete...
2019/04/10 17:16:01 Starting build run: docker
2019/04/10 17:16:01 Running builder: docker
2019/04/10 17:16:01 [INFO] (telemetry) Starting builder docker
2019/04/10 17:16:01 packer: 2019/04/10 17:16:01 [DEBUG] Docker version: 18.9.2
2019/04/10 17:16:01 packer: 2019/04/10 17:16:01 [DEBUG] Container will be committed
==> docker: Creating a temporary directory for sharing data...
2019/04/10 17:16:01 packer: 2019/04/10 17:16:01 Detected home directory from env var: /Users/fred
2019/04/10 17:16:01 packer: 2019/04/10 17:16:01 Pull disabled, won't docker pull
==> docker: Starting docker container...
docker: Run command: docker run -v /Users/fred/.packer.d/tmp:/packer-files -d -i -t ep-issue:parent /bin/bash
2019/04/10 17:16:01 packer: 2019/04/10 17:16:01 Starting container with args: [run -v /Users/fred/.packer.d/tmp:/packer-files -d -i -t ep-issue:parent /bin/bash]
2019/04/10 17:16:01 packer: 2019/04/10 17:16:01 Waiting for container to finish starting
docker: Container ID: ad01e723a58554ce83abffbcc17cf27613662c3ba40b3b995f6d777463b695f9
==> docker: Using docker communicator to connect: 172.17.0.3
2019/04/10 17:16:02 packer: 2019/04/10 17:16:02 Running the provision hook
==> docker: Committing the container
2019/04/10 17:16:02 packer: 2019/04/10 17:16:02 Committing container with args: [commit --change ENTRYPOINT [] --change CMD [] ad01e723a58554ce83abffbcc17cf27613662c3ba40b3b995f6d777463b695f9]
docker: Image ID: sha256:ca9f832de2c6e13116afa05f3e5bd68aa69b96fcf8b99f331fe38cef7b286c6c
==> docker: Killing the container: ad01e723a58554ce83abffbcc17cf27613662c3ba40b3b995f6d777463b695f9
2019/04/10 17:16:02 [INFO] (telemetry) ending docker
2019/04/10 17:16:02 [INFO] (telemetry) Starting post-processor docker-tag
==> docker: Running post-processor: docker-tag
docker (docker-tag): Tagging image: sha256:ca9f832de2c6e13116afa05f3e5bd68aa69b96fcf8b99f331fe38cef7b286c6c
docker (docker-tag): Repository: ep-issue:child2
2019/04/10 17:16:02 [INFO] (telemetry) ending docker-tag
2019/04/10 17:16:02 Flagging to keep original artifact from post-processor 'docker-tag'
Build 'docker' finished.
2019/04/10 17:16:02 Builds completed. Waiting on interrupt barrier...
==> Builds finished. The artifacts of successful builds are:
2019/04/10 17:16:02 machine readable: docker,artifact-count []string{"2"}
==> Builds finished. The artifacts of successful builds are:
2019/04/10 17:16:02 machine readable: docker,artifact []string{"0", "builder-id", "packer.post-processor.docker-import"}
2019/04/10 17:16:02 machine readable: docker,artifact []string{"0", "id", "sha256:ca9f832de2c6e13116afa05f3e5bd68aa69b96fcf8b99f331fe38cef7b286c6c"}
2019/04/10 17:16:02 machine readable: docker,artifact []string{"0", "string", "Imported Docker image: sha256:ca9f832de2c6e13116afa05f3e5bd68aa69b96fcf8b99f331fe38cef7b286c6c"}
2019/04/10 17:16:02 machine readable: docker,artifact []string{"0", "files-count", "0"}
2019/04/10 17:16:02 machine readable: docker,artifact []string{"0", "end"}
--> docker: Imported Docker image: sha256:ca9f832de2c6e13116afa05f3e5bd68aa69b96fcf8b99f331fe38cef7b286c6c
2019/04/10 17:16:02 machine readable: docker,artifact []string{"1", "builder-id", "packer.post-processor.docker-tag"}
2019/04/10 17:16:02 machine readable: docker,artifact []string{"1", "id", "ep-issue:child2"}
2019/04/10 17:16:02 machine readable: docker,artifact []string{"1", "string", "Imported Docker image: ep-issue:child2"}
2019/04/10 17:16:02 machine readable: docker,artifact []string{"1", "files-count", "0"}
2019/04/10 17:16:02 machine readable: docker,artifact []string{"1", "end"}
2019/04/10 17:16:02 [INFO] (telemetry) Finalizing.
--> docker: Imported Docker image: ep-issue:child2
2019/04/10 17:16:04 waiting for all plugin processes to complete...
2019/04/10 17:16:04 /usr/local/bin/packer: plugin process exited
2019/04/10 17:16:04 /usr/local/bin/packer: plugin process exited
#!/usr/bin/env bash
cat > entrypoint.sh <<EOF
#!/bin/sh
echo "FAIL im am the parent entrypoint"
exec "\${@}"
EOF
# build parent container with entrypoint
docker build --tag ep-issue:parent . -f-<<EOF
FROM alpine:3.7
ADD entrypoint.sh /usr/local/bin/entrypoint.sh
RUN chmod 0755 /usr/local/bin/entrypoint.sh
ENTRYPOINT ["/usr/local/bin/entrypoint.sh"]
CMD []
EOF
# build child container reset entrypoint
docker build --tag ep-issue:child1 -<<EOF
FROM ep-issue:parent
# reset entry point
ENTRYPOINT []
CMD []
EOF
# build same in packer
cat > child2.json <<EOF
{
"builders": [
{
"type": "docker",
"image": "ep-issue:parent",
"pull": "false",
"commit": "true",
"changes": [
"ENTRYPOINT []",
"CMD []"
]
}
],
"post-processors": [
{
"type": "docker-tag",
"repository": "ep-issue",
"tag": "child2"
}
]
}
EOF
PACKER_LOG=1 packer build child2.json
printf '\nInspecting container entrypoints:\n'
# expect to see an entrypoint
printf '\nparent entrypoint: ' && docker inspect ep-issue:parent | jq '.[].Config.Entrypoint'
# expect to see NO entrypoint
printf '\nchild 1 entrypoint: ' && docker inspect ep-issue:child1 | jq '.[].Config.Entrypoint'
# expect to see NO entrypoint
printf '\nchild 2 entrypoint: ' && docker inspect ep-issue:child2 | jq '.[].Config.Entrypoint'
printf '\nRunning both containers:\n'
# if we ru container, no entrypoint output should be displayed
printf '\nchild 1 result: ' &&docker run --rm ep-issue:child1 true
# same for the packer build
printf '\nchild 2 result: ' &&docker run --rm ep-issue:child2 true
rm -f entrypoint.sh child2.json
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment