Skip to content

Instantly share code, notes, and snippets.

@wancaibida
Created April 14, 2020 13:17
Show Gist options
  • Save wancaibida/d62ce7f05891939dc9f36027b56420dd to your computer and use it in GitHub Desktop.
Save wancaibida/d62ce7f05891939dc9f36027b56420dd to your computer and use it in GitHub Desktop.
Dockerfile multiple stage example
FROM ubuntu:18.04 AS builder
WORKDIR /app/
RUN apt-get update
RUN apt-get install -y build-essential libpoppler-private-dev libleptonica-dev pkg-config git
RUN git clone https://github.com/allenai/pdffigures.git
WORKDIR pdffigures
RUN make DEBUG=0
RUN ldd ./pdffigures | tr -s '[:blank:]' '\n' | grep '^/' | xargs -I % sh -c 'mkdir -p $(dirname deps%); cp % deps%;'
FROM ubuntu:18.04
WORKDIR /usr/src/app
COPY --from=builder /app/pdffigures/deps /
COPY --from=builder /app/pdffigures/pdffigures .
CMD [ "echo", "hello world" ]
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment