Skip to content

Instantly share code, notes, and snippets.

@flx42
Created June 13, 2018 03:00
Show Gist options
  • Save flx42/97b9f20e2ea04013843955f86e780254 to your computer and use it in GitHub Desktop.
Save flx42/97b9f20e2ea04013843955f86e780254 to your computer and use it in GitHub Desktop.
--cache-from issue with config.Cmd
#!/bin/bash
set -eux
docker rmi cache test || true
docker build -t cache --label "ref=12345" - <<EOF
FROM alpine
ENV VAR value
EOF
# Should be /bin/sh
docker inspect cache -f '{{ .Config.Cmd }}'
# save/rmi/load the image. The bug also exists with push/rmi/pull
docker save cache -o image.tar
docker rmi cache
docker load -i image.tar
# Should still be /bin/sh
docker inspect cache -f '{{ .Config.Cmd }}'
# Same than above, but without the --label and with --cache-from
docker build --cache-from=cache -t test - <<EOF
FROM alpine
ENV VAR value
EOF
# *NOT* /bin/sh
docker inspect test -f '{{ .Config.Cmd }}'
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment