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:
parent
0bcb955258
commit
5359c56c77
15
Dockerfile
15
Dockerfile
@ -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
|
||||||
|
|
||||||
|
Loading…
Reference in New Issue
Block a user