Initial commit

This commit is contained in:
Manuel 2023-04-07 08:32:00 +02:00
commit 297e6bfaf9
Signed by: SunRed
GPG Key ID: 4085037435E1F07A
5 changed files with 94 additions and 0 deletions

33
Dockerfile.alpine Normal file
View File

@ -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

21
LICENSE.txt Normal file
View File

@ -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.

1
README.md Normal file
View File

@ -0,0 +1 @@
# V programming language docker images

14
base/Dockerfile.alpine Normal file
View File

@ -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

25
docker-bake.hcl Normal file
View File

@ -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"
}
}