├── .gitattributes ├── docker ├── vlang │ ├── Dockerfile.ubuntu.dev-full │ ├── Dockerfile.debian.dev-full │ ├── Dockerfile.alpine.dev-full │ ├── Dockerfile.alpine.build │ ├── Dockerfile.ubuntu │ ├── Dockerfile.debian.build │ ├── Dockerfile.debian │ ├── Dockerfile.alpine │ ├── Dockerfile.ubuntu.build │ └── Dockerfile.alpine.minimal └── base │ ├── Dockerfile.alpine │ ├── Dockerfile.debian │ └── os │ └── ubuntu │ └── Dockerfile.focal ├── examples ├── README.md └── vweb │ └── README.md ├── .github └── workflows │ ├── build_ubuntu.yml │ ├── base.yml │ ├── build.yml │ └── nightly_builds.yml ├── LICENSE └── README.md /.gitattributes: -------------------------------------------------------------------------------- 1 | Dockerfile.* linguist-language=Dockerfile 2 | -------------------------------------------------------------------------------- /docker/vlang/Dockerfile.ubuntu.dev-full: -------------------------------------------------------------------------------- 1 | # Generates basic image with compiled V using tcc 2 | FROM thevlang/vlang:ubuntu-build 3 | 4 | LABEL maintainer="helto4real " 5 | 6 | WORKDIR /opt/vlang 7 | 8 | RUN git clone https://github.com/vlang/v /opt/vlang && \ 9 | make CC=clang && v -version && \ 10 | mkdir /src -------------------------------------------------------------------------------- /examples/README.md: -------------------------------------------------------------------------------- 1 | # Examples 2 | 3 | This folder contains examples using the V docker images. 4 | 5 | | example | Description | 6 | | --------------- | --------------------------------------------------- | 7 | | vweb | Minimal vweb example deployed in docker container (comming soon) | 8 | 9 | -------------------------------------------------------------------------------- /docker/vlang/Dockerfile.debian.dev-full: -------------------------------------------------------------------------------- 1 | ARG USER=thevlang 2 | 3 | # Generates development image based on Debian, with V compiled using clang 4 | FROM ${USER}/vlang:debian-build 5 | 6 | LABEL org.opencontainers.image.authors="helto4real , Sandro Martini " 7 | 8 | WORKDIR /opt/vlang 9 | 10 | RUN git clone --depth 1 https://github.com/vlang/v /opt/vlang && \ 11 | make CC=clang && v -version && \ 12 | mkdir /src 13 | 14 | WORKDIR /src -------------------------------------------------------------------------------- /docker/vlang/Dockerfile.alpine.dev-full: -------------------------------------------------------------------------------- 1 | ARG USER=thevlang 2 | 3 | # Generates development image based on Alpine, with V compiled using clang 4 | FROM ${USER}/vlang:alpine-build 5 | 6 | LABEL org.opencontainers.image.authors="helto4real , Sandro Martini " 7 | 8 | WORKDIR /opt/vlang 9 | 10 | RUN git clone --depth 1 https://github.com/vlang/v /opt/vlang && \ 11 | make VFLAGS='-cc gcc' && v -version && \ 12 | mkdir /src 13 | 14 | WORKDIR /src -------------------------------------------------------------------------------- /docker/base/Dockerfile.alpine: -------------------------------------------------------------------------------- 1 | # This is the dockerfile for generating base images for Alpine 2 | # contains the minimal dependencies needed for V to run 3 | FROM alpine:3.18 4 | 5 | LABEL maintainer="helto4real " 6 | 7 | WORKDIR /opt/vlang 8 | 9 | ENV VVV /opt/vlang 10 | ENV PATH /opt/vlang:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin 11 | 12 | RUN mkdir -p /opt/vlang && ln -s /opt/vlang/v /usr/bin/v 13 | 14 | RUN apk update && \ 15 | # Default base depenencies 16 | apk add --no-cache openssl-dev sqlite-dev libc6-compat 17 | 18 | -------------------------------------------------------------------------------- /docker/base/Dockerfile.debian: -------------------------------------------------------------------------------- 1 | # This is the dockerfile for generating base images for Buster 2 | 3 | FROM debian:12 4 | 5 | LABEL maintainer="helto4real " 6 | 7 | WORKDIR /opt/vlang 8 | 9 | ENV VVV /opt/vlang 10 | ENV PATH /opt/vlang:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin 11 | 12 | RUN mkdir -p /opt/vlang && ln -s /opt/vlang/v /usr/bin/v 13 | 14 | RUN apt-get update && \ 15 | DEBIAN_FRONTEND=noninteractive && \ 16 | # Default base depenencies 17 | apt-get install -y --no-install-recommends libssl-dev libsqlite3-dev && \ 18 | # Clean 19 | apt-get clean && rm -rf /var/cache/apt/archives/* && \ 20 | rm -rf /var/lib/apt/lists/* 21 | 22 | -------------------------------------------------------------------------------- /docker/vlang/Dockerfile.alpine.build: -------------------------------------------------------------------------------- 1 | # Builder image with alpine base, used as builder stage 2 | # for multi-stage builds. Also base for full dev image 3 | # - All dependecies 4 | # - clang compiler (and gcc needed for clang to work on alpine) 5 | # - nodejs for js backend 6 | 7 | ARG USER=thevlang 8 | 9 | # Stage 1 - Build the V-compiler 10 | FROM ${USER}/vlang:alpine-base 11 | 12 | # Add the build dependencies 13 | RUN apk --no-cache add \ 14 | # Git support 15 | git openssh-client \ 16 | # js back-end 17 | nodejs npm \ 18 | # V-development dependencies 19 | make musl-dev valgrind clang gcc \ 20 | # V-UI dependencies 21 | libx11-dev glfw-dev freetype-dev \ 22 | # compilation/optimization utilities 23 | upx -------------------------------------------------------------------------------- /docker/vlang/Dockerfile.ubuntu: -------------------------------------------------------------------------------- 1 | # Generates builder with ubuntu base 2 | FROM thevlang/vlang:ubuntu-build AS builder 3 | 4 | LABEL maintainer="helto4real " 5 | 6 | WORKDIR /opt/vlang 7 | 8 | # Install V 9 | RUN git clone https://github.com/vlang/v /opt/vlang && make && v -version 10 | 11 | FROM thevlang/vlang:ubuntu-base AS runtime 12 | 13 | LABEL maintainer="helto4real " 14 | 15 | WORKDIR /opt/vlang 16 | 17 | RUN apt-get update && \ 18 | apt-get install -y --no-install-recommends \ 19 | clang llvm-dev tcc && \ 20 | apt-get clean && rm -rf /var/cache/apt/archives/* && \ 21 | rm -rf /var/lib/apt/lists/* 22 | 23 | # Copy the prebuilt V compiler 24 | COPY --from=builder /opt/vlang /opt/vlang -------------------------------------------------------------------------------- /docker/base/os/ubuntu/Dockerfile.focal: -------------------------------------------------------------------------------- 1 | # This is the dockerfile for generating base images for ubuntu Buster 2 | # contains the minimal dependencies needed for V to run 3 | FROM ubuntu:20.04 4 | 5 | LABEL maintainer="helto4real " 6 | 7 | WORKDIR /opt/vlang 8 | 9 | ENV VVV /opt/vlang 10 | ENV PATH /opt/vlang:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin 11 | 12 | RUN mkdir -p /opt/vlang && ln -s /opt/vlang/v /usr/bin/v 13 | 14 | RUN apt-get update && \ 15 | DEBIAN_FRONTEND=noninteractive && \ 16 | # Default base depenencies 17 | apt-get install -y --no-install-recommends libssl-dev libsqlite3-dev && \ 18 | # Clean 19 | apt-get clean && rm -rf /var/cache/apt/archives/* && \ 20 | rm -rf /var/lib/apt/lists/* 21 | 22 | -------------------------------------------------------------------------------- /.github/workflows/build_ubuntu.yml: -------------------------------------------------------------------------------- 1 | #### Publish to docker hub 2 | name: Build and deploy Ubuntu builder image 3 | on: 4 | push: 5 | branches: 6 | - master 7 | paths: 8 | - '.github/workflows/build_ubuntu.yml' 9 | - 'docker/vlang/Dockerfile.ubuntu.build' 10 | workflow_dispatch: 11 | 12 | jobs: 13 | deploy: 14 | name: Checkout and deploy 15 | runs-on: ubuntu-latest 16 | steps: 17 | - uses: actions/checkout@v1 18 | - uses: docker/build-push-action@v1 19 | with: 20 | username: ${{ secrets.DOCKER_USERNAME }} 21 | password: ${{ secrets.DOCKER_TOKEN }} 22 | repository: thevlang/vlang 23 | tags: ubuntu-build 24 | dockerfile: ${{github.workspace}}/docker/vlang/Dockerfile.ubuntu.build -------------------------------------------------------------------------------- /docker/vlang/Dockerfile.debian.build: -------------------------------------------------------------------------------- 1 | 2 | ARG USER=thevlang 3 | 4 | # Stage 1 - Build the V-compiler 5 | FROM ${USER}/vlang:debian-base AS builder 6 | 7 | LABEL org.opencontainers.image.authors="helto4real , Sandro Martini " 8 | 9 | WORKDIR /opt/vlang 10 | 11 | RUN apt-get update && \ 12 | apt-get install --no-install-recommends -y \ 13 | # Git support 14 | git openssh-client \ 15 | # V-development dependencies 16 | clang llvm-dev valgrind make \ 17 | # V-UI dependencies 18 | libx11-dev libglfw3-dev libfreetype6-dev \ 19 | # wget 20 | wget \ 21 | # Certs 22 | ca-certificates && \ 23 | # Get NodeJS setup script 24 | wget -qO- "http://deb.nodesource.com/setup_18.x" | sh - && \ 25 | # Install NodeJS and clean up 26 | apt-get update && \ 27 | apt-get install --no-install-recommends -y \ 28 | nodejs && \ 29 | apt-get clean && rm -rf /var/cache/apt/archives/* && \ 30 | rm -rf /var/lib/apt/lists/* -------------------------------------------------------------------------------- /docker/vlang/Dockerfile.debian: -------------------------------------------------------------------------------- 1 | # Minimal image for compiling V programs 2 | # - No UI dependencies 3 | # - gcc compiler (only works on alpine) 4 | 5 | ARG USER=thevlang 6 | # Stage 1 - Build the V-compiler 7 | FROM ${USER}/vlang:alpine-build AS builder 8 | 9 | WORKDIR /opt/vlang 10 | 11 | RUN git clone --depth 1 https://github.com/vlang/v /opt/vlang && make VFLAGS='-cc gcc' && v -version 12 | 13 | # Stage 2 - Make minimal runtime without git and make 14 | # we still nedd gcc and musl-dev for v to compile; 15 | # libexecinfo is needed for the bundled tcc to work; 16 | # libc-dev is needed for the various C headers like inttypes.h . 17 | 18 | FROM ${USER}/vlang:alpine-base AS runtime 19 | 20 | ENV VFLAGS="-cc gcc" 21 | 22 | RUN apk --no-cache add \ 23 | gcc musl-dev git libc-dev 24 | # libexecinfo-static libexecinfo-dev : was removed since Alpine 3.17, check if still needed or remove this line 25 | 26 | # Copy the prebuilt V compiler 27 | COPY --from=builder /opt/vlang /opt/vlang 28 | 29 | WORKDIR /src -------------------------------------------------------------------------------- /docker/vlang/Dockerfile.alpine: -------------------------------------------------------------------------------- 1 | # Minimal image for compiling V programs 2 | # - No UI dependencies 3 | # - gcc compiler (only works on alpine) 4 | 5 | ARG USER=thevlang 6 | 7 | # Stage 1 - Build the V-compiler 8 | FROM ${USER}/vlang:alpine-build AS builder 9 | 10 | WORKDIR /opt/vlang 11 | 12 | RUN git clone --depth 1 https://github.com/vlang/v /opt/vlang && make VFLAGS='-cc gcc' && v -version 13 | 14 | # Stage 2 - Make minimal runtime without git and make 15 | # we still nedd gcc and musl-dev for v to compile; 16 | # libexecinfo is needed for the bundled tcc to work; 17 | # libc-dev is needed for the various C headers like inttypes.h . 18 | 19 | FROM ${USER}/vlang:alpine-base AS runtime 20 | 21 | ENV VFLAGS="-cc gcc" 22 | 23 | RUN apk --no-cache add \ 24 | gcc musl-dev git libc-dev 25 | # libexecinfo-static libexecinfo-dev : was removed since Alpine 3.17, check if still needed or remove this line 26 | 27 | # Copy the prebuilt V compiler 28 | COPY --from=builder /opt/vlang /opt/vlang 29 | 30 | WORKDIR /src -------------------------------------------------------------------------------- /docker/vlang/Dockerfile.ubuntu.build: -------------------------------------------------------------------------------- 1 | # Generates builder with ubuntu base 2 | FROM thevlang/vlang:ubuntu-base AS builder 3 | 4 | LABEL maintainer="helto4real " 5 | 6 | WORKDIR /opt/vlang 7 | 8 | RUN apt-get update && \ 9 | echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections && \ 10 | apt-get install --no-install-recommends -y \ 11 | # Curl support 12 | wget \ 13 | # Git support 14 | git openssh-client \ 15 | # musl support \ 16 | musl musl-tools \ 17 | # V-development dependencies 18 | clang llvm-dev valgrind make \ 19 | # V-UI dependencies 20 | libx11-dev libglfw3-dev libfreetype6-dev \ 21 | # Certs 22 | ca-certificates && \ 23 | # Get NodeJS setup script 24 | wget -qO- "http://deb.nodesource.com/setup_14.x" | sh - && \ 25 | # Install NodeJS and clean up 26 | apt-get update && \ 27 | apt-get install --no-install-recommends -y \ 28 | nodejs && \ 29 | apt-get clean && rm -rf /var/cache/apt/archives/* && \ 30 | rm -rf /var/lib/apt/lists/* -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | MIT License 2 | 3 | Copyright (c) 2020 Tomas Hellström 4 | 5 | Permission is hereby granted, free of charge, to any person obtaining a copy 6 | of this software and associated documentation files (the "Software"), to deal 7 | in the Software without restriction, including without limitation the rights 8 | to use, copy, modify, merge, publish, distribute, sublicense, and/or sell 9 | copies of the Software, and to permit persons to whom the Software is 10 | furnished to do so, subject to the following conditions: 11 | 12 | The above copyright notice and this permission notice shall be included in all 13 | copies or substantial portions of the Software. 14 | 15 | THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR 16 | IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, 17 | FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE 18 | AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER 19 | LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, 20 | OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE 21 | SOFTWARE. 22 | -------------------------------------------------------------------------------- /examples/vweb/README.md: -------------------------------------------------------------------------------- 1 | # vweb runtime example 2 | 3 | Create a `Dockerfile` with the following content in the root of your project: 4 | 5 | ```Dockerfile 6 | from thevlang/vlang:alpine-build as base 7 | 8 | RUN apk update 9 | RUN apk add postgresql-dev 10 | 11 | from base as build 12 | 13 | RUN mkdir -p /home/vlang 14 | 15 | WORKDIR /home/vlang/ 16 | 17 | COPY v.mod . 18 | COPY src src 19 | COPY static static 20 | 21 | # Install repo dependencies 22 | RUN v install 23 | RUN v -prod -o vweb-app . 24 | 25 | RUN ls 26 | 27 | RUN pwd 28 | 29 | from base as runtime 30 | 31 | WORKDIR /home/vlang 32 | COPY --from=build /home/vlang/vweb-app . 33 | COPY static static 34 | 35 | EXPOSE 8081 36 | 37 | ENTRYPOINT ["./vweb-app"] 38 | ``` 39 | 40 | Now you can build it with `docker built -t test .` and run it with `docker run test --rm --port 8081:8081` 41 | 42 | ## Features 43 | 44 | - [x] Multi-stage build of image 45 | - [x] Compressed binary 46 | 47 | 48 | ## Other examples 49 | * [west_sample](https://github.com/Dracks/west_sample/): you can see here a project with github workflows configured of how to generate a docker image of a V project and publish it into docker hub 50 | -------------------------------------------------------------------------------- /docker/vlang/Dockerfile.alpine.minimal: -------------------------------------------------------------------------------- 1 | FROM alpine:latest AS vlang-sdk 2 | MAINTAINER msheriffusa 3 | 4 | WORKDIR /opt/v/ 5 | 6 | # 215MB 7 | RUN apk add --update alpine-sdk 8 | 9 | # 30MB 10 | RUN wget https://github.com/vlang/v/releases/download/0.4.4/v_linux.zip -O /opt/v.zip 11 | 12 | # 90MB 13 | RUN unzip /opt/v.zip -d /opt/ 14 | 15 | RUN make 16 | 17 | # delete files not required in a docker run image (removes 25 dirs) 18 | RUN rm -rf doc examples/ tutorials/ vc/ ./vlib/v/tests/ \ 19 | ./vlib/v/slow_tests/ ./vlib/v/embed_file/tests/ \ 20 | ./cmd/tools/vdoc/tests ./cmd/tools/vcreate/tests \ 21 | ./cmd/tools/vvet/tests ./vlib/v/scanner/tests/ \ 22 | ./vlib/v/fmt/tests ./vlib/v/checker/tests \ 23 | ./vlib/v/gen/native/tests ./vlib/v/gen/wasm/tests \ 24 | ./vlib/v/gen/js/tests ./vlib/v/eval/tests \ 25 | ./vlib/v/gen/golang/tests ./vlib/v/parser/tests/ \ 26 | ./vlib/toml/tests/ ./vlib/net/websocket/tests \ 27 | ./vlib/x/vweb/tests ./vlib/vweb/tests ./vlib/v2/tests ./vlib/wasm/tests 28 | 29 | FROM alpine:latest AS vlang 30 | MAINTAINER msheriffusa 31 | WORKDIR /opt/ 32 | 33 | # 90MB 34 | COPY --from=vlang-sdk /opt/v/ . 35 | 36 | # 215MB 37 | RUN apk add --update alpine-sdk 38 | 39 | RUN ./v symlink 40 | 41 | CMD ["v"] 42 | -------------------------------------------------------------------------------- /.github/workflows/base.yml: -------------------------------------------------------------------------------- 1 | #### Publish to docker hub 2 | name: Build and deploy All base images 3 | on: 4 | push: 5 | branches: 6 | - master 7 | pull_request: 8 | branches: [master] 9 | paths: 10 | - '.github/workflows/base.yml' 11 | - 'docker/base/Dockerfile.alpine' 12 | - 'docker/base/Dockerfile.debian' 13 | workflow_dispatch: 14 | 15 | jobs: 16 | deploy: 17 | name: Checkout and deploy 18 | runs-on: ubuntu-latest 19 | strategy: 20 | matrix: 21 | os: 22 | - alpine 23 | - debian 24 | steps: 25 | - uses: actions/checkout@v1 26 | - name: Set up QEMU 27 | uses: docker/setup-qemu-action@v2 28 | - name: Set up Docker Buildx 29 | uses: docker/setup-buildx-action@v2 30 | - name: Login to Docker Hub 31 | uses: docker/login-action@v2 32 | with: 33 | username: ${{ secrets.DOCKER_USERNAME }} 34 | password: ${{ secrets.DOCKER_TOKEN }} 35 | - uses: docker/build-push-action@v4 36 | with: 37 | platforms: ${{ vars.PLATFORMS}} 38 | tags: ${{ vars.DOCKER_REPOSITORY }}/vlang:${{ matrix.os }}-base 39 | push: ${{ github.event_name != 'pull_request' }} 40 | file: docker/base/Dockerfile.${{ matrix.os }} 41 | -------------------------------------------------------------------------------- /.github/workflows/build.yml: -------------------------------------------------------------------------------- 1 | #### Publish to docker hub 2 | name: Build and deploy All builder image 3 | on: 4 | push: 5 | branches: 6 | - master 7 | pull_request: 8 | branches: [master] 9 | paths: 10 | - '.github/workflows/build.yml' 11 | - 'docker/vlang/Dockerfile.alpine.build' 12 | - 'docker/vlang/Dockerfile.debian.build' 13 | workflow_dispatch: 14 | 15 | jobs: 16 | deploy: 17 | name: Checkout and deploy 18 | runs-on: ubuntu-latest 19 | strategy: 20 | matrix: 21 | os: 22 | - alpine 23 | - debian 24 | steps: 25 | - uses: actions/checkout@v1 26 | - name: Set up QEMU 27 | uses: docker/setup-qemu-action@v2 28 | - name: Set up Docker Buildx 29 | uses: docker/setup-buildx-action@v2 30 | - name: Login to Docker Hub 31 | uses: docker/login-action@v2 32 | with: 33 | username: ${{ secrets.DOCKER_USERNAME }} 34 | password: ${{ secrets.DOCKER_TOKEN }} 35 | - uses: docker/build-push-action@v4 36 | with: 37 | platforms: ${{ vars.PLATFORMS}} 38 | tags: ${{ vars.DOCKER_REPOSITORY }}/vlang:${{ matrix.os}}-build 39 | push: ${{ github.event_name != 'pull_request' }} 40 | file: docker/vlang/Dockerfile.${{ matrix.os }}.build 41 | build-args: "USER=${{vars.DOCKER_REPOSITORY}}" 42 | -------------------------------------------------------------------------------- /.github/workflows/nightly_builds.yml: -------------------------------------------------------------------------------- 1 | #### Publish tags to docker hub 2 | name: Deploy nightly build to Dockerhub 3 | on: 4 | workflow_dispatch: 5 | # for manually trigger workflow 6 | push: 7 | branches: 8 | - master 9 | pull_request: 10 | branches: [master] 11 | paths: 12 | - ".github/workflows/nightly_builds.yml" 13 | schedule: 14 | - cron: "0 2 * * *" # run at 2 AM UTC 15 | 16 | jobs: 17 | deploy_latest: 18 | name: Checkout and deploy 19 | runs-on: ubuntu-latest 20 | strategy: 21 | matrix: 22 | os: 23 | - alpine 24 | - debian 25 | steps: 26 | - uses: actions/checkout@v1 27 | - name: Set up QEMU 28 | uses: docker/setup-qemu-action@v2 29 | - name: Set up Docker Buildx 30 | uses: docker/setup-buildx-action@v2 31 | - name: Login to Docker Hub 32 | uses: docker/login-action@v2 33 | with: 34 | username: ${{ secrets.DOCKER_USERNAME }} 35 | password: ${{ secrets.DOCKER_TOKEN }} 36 | - name: generate tags conditionally 37 | id: gen_tags 38 | run: | 39 | if [[ ${{ matrix.os }} == 'debian' ]]; then 40 | echo 'TAGS=${{ vars.DOCKER_REPOSITORY }}/vlang:latest,${{ vars.DOCKER_REPOSITORY }}/vlang:${{ matrix.os }}' >> $GITHUB_OUTPUT 41 | else 42 | echo 'TAGS=${{ vars.DOCKER_REPOSITORY }}/vlang:${{ matrix.os }}' >> $GITHUB_OUTPUT 43 | fi 44 | - uses: docker/build-push-action@v4 45 | name: Build and deploy v image 46 | with: 47 | platforms: ${{ vars.PLATFORMS }} 48 | tags: ${{ steps.gen_tags.outputs.TAGS }} 49 | file: docker/vlang/Dockerfile.${{ matrix.os }} 50 | push: ${{ github.event_name != 'pull_request' }} 51 | build-args: "USER=${{vars.DOCKER_REPOSITORY}}" 52 | - uses: docker/build-push-action@v4 53 | name: Build and deploy developer build 54 | with: 55 | platforms: ${{ vars.PLATFORMS }} 56 | tags: ${{ vars.DOCKER_REPOSITORY }}/vlang:${{ matrix.os }}-dev 57 | file: docker/vlang/Dockerfile.${{ matrix.os }}.dev-full 58 | build-args: "USER=${{vars.DOCKER_REPOSITORY}}" 59 | push: ${{ github.event_name != 'pull_request' }} 60 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | ![GitHub Workflow Status](https://img.shields.io/github/workflow/status/vlang/docker/Deploy%20nightly%20build%20to%20Dockerhub) 2 | [![Docker Pulls](https://img.shields.io/docker/pulls/thevlang/vlang)](https://hub.docker.com/r/thevlang/vlang) 3 | [![Docker Image Size (latest by date)](https://img.shields.io/docker/image-size/thevlang/vlang)](https://hub.docker.com/r/thevlang/vlang/tags?page=1&ordering=last_updated) 4 | 5 | # V programming language docker images source (Work in progress) 6 | The docker files for the V programming language. Please check individual `Dockerfile` for what is provided in detail 7 | 8 | Works both with docker for linux and windows on x86 plattform. 9 | 10 | ## WIP 11 | 12 | - [x] Basic images 13 | - [ ] Get nightly builds working 14 | - [ ] Provide examples of usage (vweb @smartiniOnGitHub example) 15 | 16 | ## Structure 17 | 18 | | folder | Description | 19 | | --------------- | --------------------------------------------------- | 20 | | base/os | Docker files for supported os. Minimal dependencies | 21 | | vlang | Docker files for `thevlang/vlang` images | 22 | 23 | ## Structure of the image 24 | 25 | The images are deployed as `thevlang/vlang:tag`. 26 | 27 | # Usage 28 | 29 | ## 1. Installing docker 30 | 31 | [Here are installation instructions on ubuntu](https://docs.docker.com/engine/install/ubuntu/) but there are instructions for other distributions too. 32 | 33 | ## 2 Running the image 34 | 35 | ### Choose your image 36 | 37 | Browse [thevlang/vlang](https://hub.docker.com/r/thevlang/vlang/tags?page=1&ordering=last_updated) on Docker Hub and choose your tag. 38 | 39 | ### Running the standard image 40 | 41 | Running the development image using iteractive terminal. 42 | 43 | ```bash 44 | docker run \ 45 | -it \ 46 | --name v-container \ 47 | thevlang/vlang \ 48 | /bin/bash 49 | ``` 50 | 51 | ### Running the development image 52 | 53 | Running the development image using iteractive terminal and mapping current directory to internal /src directory. 54 | ```bash 55 | docker run \ 56 | -it \ 57 | -v ${PWD}:/src \ 58 | --name v-dev-container \ 59 | thevlang/vlang:alpine-dev \ 60 | /bin/sh 61 | ``` 62 | 63 | ### Using Docker Compose 64 | 65 | Creating a container ready to go in. 66 | 67 | ```yml 68 | version: "3" 69 | services: 70 | v: 71 | image: thevlang/vlang:alpine 72 | tty: true # Keeps your container running 73 | volumes: 74 | - .:/home/v 75 | working_dir: /home/v 76 | ``` 77 | 78 | Use it: 79 | 80 | ```bash 81 | you@pc > docker-compose exec v sh 82 | $ v --version 83 | V 0.2.2 f4486d7 84 | ``` 85 | 86 | Creating a disposable container. 87 | 88 | ```yml 89 | version: "3" 90 | services: 91 | v: 92 | image: thevlang/vlang:alpine 93 | entrypoint: v 94 | volumes: 95 | - .:/home/v 96 | working_dir: /home/v 97 | ``` 98 | 99 | Use it: 100 | 101 | ```bash 102 | you@pc > docker-compose run v --version 103 | V 0.2.2 f4486d7 104 | ``` 105 | 106 | # Different images being built 107 | 108 | Following images are built from this repo: 109 | 110 | | tag | Description | 111 | | --------------- | ----------------- | 112 | | latest | Nightly build of latest V on Debian Buster| 113 | | \[githash\] | The sha commit id built (soon supported)| 114 | | buster | Nightly build of latest V on Debian Buster| 115 | | alpine | Nightly build of latest V on Alpine 3.11 | 116 | | ubuntu | Nightly build of latest V on Ubuntu 20.04| 117 | | runtime-scratch | Minimal size scratch based image with runtime dependencies (soon supported)| 118 | | \[dist\]-build | Used in V CI builds to build V itself. No V included in image.| 119 | | \[dist\]-dev | Development build with all development dependecies on distributions.| 120 | 121 | --------------------------------------------------------------------------------