forked from vlang/v
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.alpine
77 lines (60 loc) · 1.71 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
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
FROM alpine:3.20
LABEL maintainer="spytheman <[email protected]>"
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
RUN apk --no-cache add \
openssl-dev sqlite-dev mbedtls \
libuv-dev libev-dev libevent-dev libmemcached-dev
RUN apk --no-cache add \
binutils diffutils elfutils pcre strace \
libunwind-dev libunwind-static gc
RUN apk --no-cache add \
make bash file git upx
RUN apk --no-cache add gcc gdb wasi-sdk
RUN apk --no-cache add \
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
RUN apk --no-cache add \
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
RUN du -b -s .
RUN time v -prod -skip-unused doctor
RUN time v -prod -skip-unused self
RUN time v -prod -skip-unused cmd/tools/vfmt.v
RUN find . -type f -name *_test.v -or -name *.vv -or -name *.out | xargs rm
RUN rm -rf v_old vc/ .git/
RUN du -b -s .
CMD ["v"]