-
-
Notifications
You must be signed in to change notification settings - Fork 2.2k
/
Copy pathDockerfile.alpine
62 lines (59 loc) · 1.75 KB
/
Dockerfile.alpine
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
## Usage:
## 1) docker build -t vlang_alpine - < Dockerfile.alpine
## 2) alias with_alpine='docker run -u 1000:1000 --rm -it -v .:/src -w /src vlang_alpine:latest'
FROM alpine:3.20
LABEL maintainer="spytheman <spytheman@bulsynt.org>"
WORKDIR /opt/vlang
ENV PATH /opt/vlang:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin
## install development packages
RUN apk --no-cache add \
musl-dev libc-dev libc6-compat gcompat \
openssl-dev sqlite-dev mbedtls \
libuv-dev libev-dev libevent-dev libmemcached-dev \
binutils diffutils elfutils pcre strace \
libunwind-dev libunwind-static gc gc-dev \
make bash file git upx tmux micro nano nano-syntax \
gcc gdb wasi-sdk \
mesa-dev mesa-gl mesa-gles mesa-glapi \
glfw-dev \
glu-dev \
glew-dev \
freetype-dev \
freeglut-dev \
libxi-dev libxi-static \
libxcursor-dev \
libx11-dev \
icu-data-full \
sdl2_net-dev \
sdl2_gfx-dev \
sdl2_ttf-dev \
sdl2_image-dev \
sdl2_mixer-dev \
sdl2_pango-dev \
sdl2-dev
RUN ln -s /opt/vlang/v /usr/local/bin/v
COPY . /vlang-local
ARG USE_LOCAL
RUN if [[ -z "${USE_LOCAL}" ]] ; then \
git clone --depth=1 --quiet https://github.com/vlang/v/ /opt/vlang && \
rm -rf /vlang-local ; \
else \
mv /vlang-local/* . && \
rm -rf /vlang-local ; \
fi
RUN mkdir -p /tmp/v /tmp/v /home/ && chown -Rh 1000:1000 /opt/ /tmp/ /home/
## setup runtime environment for v and bash:
USER 1000:1000
ENV HOME /home
ENV VTMP /tmp/v
ENV VMODULES /tmp/vmodules
RUN make && v -version && ls -la v && \
du -b -s . && \
time v doctor && \
time v cmd/tools/vfmt.v && \
time v -prod self && \
true
RUN find . -type f -name *_test.v -or -name *.vv -or -name *.out | xargs rm && \
rm -rf v_old vc/ .git/ && \
du -b -s .
CMD ["v"]