diff --git a/Dockerfile.alpine b/Dockerfile.alpine index 2b6e2f4fa8..a8939ee476 100644 --- a/Dockerfile.alpine +++ b/Dockerfile.alpine @@ -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 " - 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 \ @@ -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 \ @@ -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 && \ @@ -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"]