Skip to content

Instantly share code, notes, and snippets.

@ybogdanov
Last active September 7, 2015 16:59
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 ybogdanov/e82a52e0b8a5521c881c to your computer and use it in GitHub Desktop.
Save ybogdanov/e82a52e0b8a5521c881c to your computer and use it in GitHub Desktop.
Example Rockerfile with multiple FROM instructions, see https://github.com/grammarly/rocker
# Build stage: will start from google/golang:1.4 and compile app.go
FROM google/golang:1.4
ADD . /src
WORKDIR /src
# Will result in putting app.o to the working directory /src
RUN CGO_ENABLED=0 go build -a -installsuffix cgo -v -o app.o app.go
# Will make app.o available in the following FROM
EXPORT app.o
# Describe "run" image based on "busybox", weights 4.3MB
FROM busybox
# Will import recently built app.o into /bin/app
IMPORT app.o /bin/app
CMD ["/bin/app"]
TAG app:latest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment