Skip to content

Commit

Permalink
Dockerfile: add support for USE_LOCAL (vlang#10953)
Browse files Browse the repository at this point in the history
  • Loading branch information
353fc443 authored Jul 25, 2021
1 parent 0bcb955 commit 5359c56
Showing 1 changed file with 14 additions and 1 deletion.
15 changes: 14 additions & 1 deletion Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -3,11 +3,24 @@ FROM buildpack-deps:buster-curl

LABEL maintainer="ANAGO Ronnel <anagoandy@gmail.com>"
WORKDIR /opt/vlang

ARG USE_LOCAL

RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends gcc clang make git && \
apt-get clean && rm -rf /var/cache/apt/archives/* && \
rm -rf /var/lib/apt/lists/*
COPY . .

COPY . /vlang-local

RUN if [ -z "${USE_LOCAL}" ] ; then \
git clone https://github.com/vlang/v/ /opt/vlang && \
rm -rf /vlang-local ; \
else \
mv /vlang-local/* . && \
rm -rf /vlang-local ; \
fi

RUN make && \
ln -s /opt/vlang/v /usr/local/bin/v

Expand Down

0 comments on commit 5359c56

Please sign in to comment.