Skip to content

Instantly share code, notes, and snippets.

@snobutaka
Created March 4, 2019 05:17
Show Gist options
  • Save snobutaka/7b47acea1cd85846eeedac51a5677673 to your computer and use it in GitHub Desktop.
Save snobutaka/7b47acea1cd85846eeedac51a5677673 to your computer and use it in GitHub Desktop.
Docker Multi Stage Build Example
FROM ubuntu:latest AS cow-builder
WORKDIR /tmp
RUN apt-get update && apt-get install -y cowsay
RUN /usr/games/cowsay 'Hello world!' > ./cow.txt
FROM ubuntu:latest
COPY --from=cow-builder /tmp/cow.txt .
CMD ["cat", "cow.txt"]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment