| 1 | ####################################################################################### |
| 2 | ## The goal of this file, is to provide an easy and reproducible way to check *locally* |
| 3 | ## the CI job `docker-alpine-musl-gcc` |
| 4 | ## Building the docker image: |
| 5 | ## docker build -t ci_alpine_local - < .github/workflows/Dockerfile.ci_alpine_local |
| 6 | ## Running the docker image, after building it: |
| 7 | ## docker run --rm -it -v .:/opt/vlang -w /opt/vlang ci_alpine_local |
| 8 | ## Once it is running, inside the container you can: |
| 9 | ## make && v -e 'println(2+2)' |
| 10 | ## ... then do whatever you need to reproduce the CI test failure. |
| 11 | ## Note: after you are finished, and exit the container, run `make` again, otherwise |
| 12 | ## you will be using V (and potentially V tools) that were compiled with musl. |
| 13 | ####################################################################################### |
| 14 | FROM thevlang/vlang:alpine-build |
| 15 | |
| 16 | LABEL maintainer="spytheman <[email protected]>" |
| 17 | |
| 18 | WORKDIR /opt/vlang |
| 19 | |
| 20 | ENV PATH /opt/vlang:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin |
| 21 | |
| 22 | ## install development packages |
| 23 | RUN apk --no-cache add \ |
| 24 | musl-dev libc-dev libc6-compat gcompat \ |
| 25 | libunwind-dev libunwind-static \ |
| 26 | gc gc-dev \ |
| 27 | binutils diffutils elfutils \ |
| 28 | strace gdb \ |
| 29 | pcre bash fzf fzf-vim tmux less file colordiff \ |
| 30 | vim vim-editorconfig \ |
| 31 | nano nano-syntax \ |
| 32 | micro |
| 33 | |
| 34 | RUN git config --global --add safe.directory /opt/vlang &&\ |
| 35 | git config --global --add safe.directory /opt/vlang/vc &&\ |
| 36 | git config --global --add safe.directory /opt/vlang/thirdparty/tcc &&\ |
| 37 | find /usr/share/nano/ -iname "*.nanorc" -exec echo include {} \; >> ~/.nanorc &&\ |
| 38 | micro -plugin install detectindent &&\ |
| 39 | micro -plugin install editorconfig &&\ |
| 40 | micro -plugin install monokai-dark &&\ |
| 41 | micro -plugin install quickfix &&\ |
| 42 | micro -plugin install runit &&\ |
| 43 | micro -plugin install cheat &&\ |
| 44 | micro -plugin install jump &&\ |
| 45 | true |
| 46 | |
| 47 | ## setup runtime environment for v and bash: |
| 48 | ENV VTMP /tmp/v |
| 49 | ENV VMODULES /tmp/vmodules |
| 50 | ENV VFLAGS "-d dynamic_boehm" |
| 51 | |
| 52 | CMD ["bash"] |
| 53 | |