This repository has been archived on 2023-09-30. You can view files and clone it, but cannot push or open issues or pull requests.
vlang-docker/Dockerfile.alpine

34 lines
929 B
Docker

# Stage 1 - Build the V-compiler
FROM git.snrd.eu/sunred/vlang:alpine-base AS builder
# Add the build dependencies
RUN apk --no-cache add \
# Git support
git openssh-client \
# js back-end
nodejs npm \
# V-development dependencies
make musl-dev valgrind clang gcc \
# V-UI dependencies
libx11-dev glfw-dev freetype-dev
WORKDIR /opt/vlang
RUN git clone https://github.com/vlang/v /opt/vlang && make VFLAGS='-cc gcc' && v -version
# Stage 2 - Make minimal runtime without git and make
# we still nedd gcc and musl-dev for v to compile;
# libexecinfo is needed for the bundled tcc to work;
# libc-dev is needed for the various C headers like inttypes.h .
FROM git.snrd.eu/sunred/vlang:alpine-base AS runtime
ENV VFLAGS="-cc gcc"
RUN apk --no-cache add \
gcc musl-dev git libc-dev
# Copy the prebuilt V compiler
COPY --from=builder /opt/vlang /opt/vlang