Skip to content

Commit

Permalink
Dockerfile.alpine: cleanup, add tools like tmux, micro for easing dia…
Browse files Browse the repository at this point in the history
…gnostics and more prolonged work
  • Loading branch information
spytheman committed Jan 7, 2025
1 parent 63db71b commit 6882900
Showing 1 changed file with 18 additions and 33 deletions.
51 changes: 18 additions & 33 deletions Dockerfile.alpine
Original file line number Diff line number Diff line change
@@ -1,29 +1,20 @@
## 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

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

RUN apk --no-cache add \
libuv-dev libev-dev libevent-dev libmemcached-dev \
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 \
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 \
Expand All @@ -32,9 +23,7 @@ RUN apk --no-cache add \
freeglut-dev \
libxi-dev libxi-static \
libxcursor-dev \
libx11-dev

RUN apk --no-cache add \
libx11-dev \
icu-data-full \
sdl2_net-dev \
sdl2_gfx-dev \
Expand All @@ -45,9 +34,7 @@ RUN apk --no-cache add \
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 && \
Expand All @@ -56,22 +43,20 @@ RUN if [[ -z "${USE_LOCAL}" ]] ; then \
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 .

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"]

0 comments on commit 6882900

Please sign in to comment.