Skip to content

Instantly share code, notes, and snippets.

@wader
Last active August 26, 2018 16:12
Show Gist options
  • Save wader/fd3fab0705cb75ecc964bc84a661d686 to your computer and use it in GitHub Desktop.
Save wader/fd3fab0705cb75ecc964bc84a661d686 to your computer and use it in GitHub Desktop.
Run command in image, for example list files in docker image
# docker build --no-cache https://gist.githubusercontent.com/wader/fd3fab0705cb75ecc964bc84a661d686/raw/ --build-arg IMAGE=alpine --build-arg CMD="find . | cut -c 2- | sort"
ARG IMAGE=alpine
FROM $IMAGE as image
FROM alpine
ARG CMD="find . | cut -c 2- | sort"
COPY --from=image / /image
WORKDIR /image
RUN $CMD
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment