commit 297e6bfaf9ffa1b9b26afc16f7a4f5df7f12aaaa Author: Manuel Date: Fri Apr 7 08:32:00 2023 +0200 Initial commit diff --git a/Dockerfile.alpine b/Dockerfile.alpine new file mode 100644 index 0000000..6ba2141 --- /dev/null +++ b/Dockerfile.alpine @@ -0,0 +1,33 @@ +# Stage 1 - Build the V-compiler +FROM git.snrd.eu/sunred/vlang:alpine-base AS builder + +# Add the build dependencies +RUN apk --no-cache add \ + # Git support + git openssh-client \ + # js back-end + nodejs npm \ + # V-development dependencies + make musl-dev valgrind clang gcc \ + # V-UI dependencies + libx11-dev glfw-dev freetype-dev + +WORKDIR /opt/vlang + +RUN git clone https://github.com/vlang/v /opt/vlang && make VFLAGS='-cc gcc' && v -version + +# Stage 2 - Make minimal runtime without git and make +# we still nedd gcc and musl-dev for v to compile; +# libexecinfo is needed for the bundled tcc to work; +# libc-dev is needed for the various C headers like inttypes.h . + +FROM git.snrd.eu/sunred/vlang:alpine-base AS runtime + +ENV VFLAGS="-cc gcc" + +RUN apk --no-cache add \ + gcc musl-dev git libc-dev + + +# Copy the prebuilt V compiler +COPY --from=builder /opt/vlang /opt/vlang diff --git a/LICENSE.txt b/LICENSE.txt new file mode 100644 index 0000000..baf0f96 --- /dev/null +++ b/LICENSE.txt @@ -0,0 +1,21 @@ +MIT License + +Copyright (c) 2022 SunRed + +Permission is hereby granted, free of charge, to any person obtaining a copy +of this software and associated documentation files (the "Software"), to deal +in the Software without restriction, including without limitation the rights +to use, copy, modify, merge, publish, distribute, sublicense, and/or sell +copies of the Software, and to permit persons to whom the Software is +furnished to do so, subject to the following conditions: + +The above copyright notice and this permission notice shall be included in all +copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR +IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, +FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE +AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER +LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, +OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE +SOFTWARE. diff --git a/README.md b/README.md new file mode 100644 index 0000000..a61d310 --- /dev/null +++ b/README.md @@ -0,0 +1 @@ +# V programming language docker images diff --git a/base/Dockerfile.alpine b/base/Dockerfile.alpine new file mode 100644 index 0000000..bee3bb5 --- /dev/null +++ b/base/Dockerfile.alpine @@ -0,0 +1,14 @@ +# This is the dockerfile for generating base images for Alpine +# contains the minimal dependencies needed for V to run +FROM alpine:latest + +WORKDIR /opt/vlang + +ENV VVV /opt/vlang +ENV PATH /opt/vlang:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin + +RUN mkdir -p /opt/vlang && ln -s /opt/vlang/v /usr/bin/v + +RUN apk update && \ + # Default base depenencies + apk add --no-cache openssl-dev sqlite-dev diff --git a/docker-bake.hcl b/docker-bake.hcl new file mode 100644 index 0000000..63869eb --- /dev/null +++ b/docker-bake.hcl @@ -0,0 +1,25 @@ +variable "REG" { + default = "git.snrd.eu" +} +variable "REPO" { + default = "sunred/vlang" +} + +group "default" { + targets = ["alpine-base", "alpine"] +} +target "alpine-base" { + output = ["type=docker"] + dockerfile = "base/Dockerfile.alpine" + tags = ["${REG}/${REPO}:alpine-base"] + #platforms = ["linux/amd64", "linux/arm64"] +} +target "alpine" { + output = ["type=docker"] + dockerfile = "Dockerfile.alpine" + tags = ["${REG}/${REPO}:alpine"] + #platforms = ["linux/amd64", "linux/arm64"] + contexts = { + "git.snrd.eu/sunred/vlang:alpine-base": "target:alpine-base" + } +}