Created
April 14, 2020 13:17
-
-
Save wancaibida/d62ce7f05891939dc9f36027b56420dd to your computer and use it in GitHub Desktop.
Dockerfile multiple stage example
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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