1
0
mirror of https://github.com/vlang/v.git synced 2023-08-10 21:13:21 +03:00

Dockerfile: add support for USE_LOCAL (#10953)

This commit is contained in:
353fc443 2021-07-25 17:07:26 +05:30 committed by GitHub
parent 0bcb955258
commit 5359c56c77
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -3,11 +3,24 @@ FROM buildpack-deps:buster-curl
LABEL maintainer="ANAGO Ronnel <anagoandy@gmail.com>" LABEL maintainer="ANAGO Ronnel <anagoandy@gmail.com>"
WORKDIR /opt/vlang WORKDIR /opt/vlang
ARG USE_LOCAL
RUN apt-get update && \ RUN apt-get update && \
DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends gcc clang make git && \ DEBIAN_FRONTEND=noninteractive apt-get install -y --no-install-recommends gcc clang make git && \
apt-get clean && rm -rf /var/cache/apt/archives/* && \ apt-get clean && rm -rf /var/cache/apt/archives/* && \
rm -rf /var/lib/apt/lists/* 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 && \ RUN make && \
ln -s /opt/vlang/v /usr/local/bin/v ln -s /opt/vlang/v /usr/local/bin/v