Skip to content

Commit

Permalink
Using multistage build for Dockerfile, reduces container size by ~1.5G
Browse files Browse the repository at this point in the history
  • Loading branch information
me authored and PeterMatula committed Jun 15, 2022
1 parent 4d65416 commit b87697c
Showing 1 changed file with 16 additions and 2 deletions.
18 changes: 16 additions & 2 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM ubuntu:focal
FROM ubuntu:focal AS builder

RUN useradd -m retdec
WORKDIR /home/retdec
Expand Down Expand Up @@ -31,4 +31,18 @@ RUN git clone https://github.com/avast/retdec && \
make -j$(nproc) && \
make install

ENV PATH /home/retdec/retdec-install/bin:$PATH
FROM ubuntu:focal

RUN useradd -m retdec
WORKDIR /home/retdec
ENV HOME /home/retdec

RUN apt-get update -y && \
DEBIAN_FRONTEND=noninteractive apt-get install -y \
openssl graphviz upx python3

USER retdec

COPY --from=builder /home/retdec/retdec-install /retdec-install

ENV PATH /retdec-install/bin:$PATH

0 comments on commit b87697c

Please sign in to comment.