Make building with docker more effecient

- cleaning up apt cache will reduce image size
- doing COPY after apt will allow to reuse previous layer on recompile
pull/1319/head
Martin Rauscher 2019-07-25 21:31:17 +02:00 committed by Alexander Medvednikov
parent ebf858b9ae
commit 8b195ba32a
1 changed files with 4 additions and 3 deletions

View File

@ -3,10 +3,11 @@ FROM buildpack-deps:buster-curl
LABEL maintainer="ANAGO Ronnel <anagoandy@gmail.com>"
WORKDIR /etc/vlang
COPY . .
RUN apt-get -yq update && \
apt-get install -y gcc clang make && \
make && \
apt-get install -y --no-install-recommends gcc clang make && \
rm -rf /var/lib/apt/lists/*
COPY . .
RUN make && \
ln -s /etc/vlang/v /usr/local/bin/v
CMD [ "bash" ]