Dockerfile.alpine: copy source, instead of cloning the repo (#10916)

pull/10944/head
353fc443 2021-07-24 18:31:32 +05:30 committed by GitHub
parent f51fa7e665
commit 42bf385ff9
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 12 additions and 1 deletions

View File

@ -10,6 +10,8 @@ ENV VFLAGS -cc gcc
RUN mkdir -p /opt/vlang && ln -s /opt/vlang/v /usr/bin/v RUN mkdir -p /opt/vlang && ln -s /opt/vlang/v /usr/bin/v
ARG USE_LOCAL
RUN apk --no-cache add \ RUN apk --no-cache add \
git make upx gcc bash \ git make upx gcc bash \
musl-dev \ musl-dev \
@ -17,7 +19,16 @@ RUN apk --no-cache add \
libx11-dev glfw-dev freetype-dev libx11-dev glfw-dev freetype-dev
## RUN apk --no-cache add --virtual sdl2deps sdl2-dev sdl2_ttf-dev sdl2_mixer-dev sdl2_image-dev ## RUN apk --no-cache add --virtual sdl2deps sdl2-dev sdl2_ttf-dev sdl2_mixer-dev sdl2_image-dev
COPY . /vlang-local
RUN git clone https://github.com/vlang/v /opt/vlang && make && v -version 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 && v -version
CMD ["v"] CMD ["v"]