mirror of
https://github.com/yggdrasil-network/yggstack.git
synced 2025-04-27 21:55:07 +03:00
Try publishing static binaries as distroless containers
Signed-off-by: Vasyl Gello <vasek.gello@gmail.com>
This commit is contained in:
parent
b534d1205e
commit
3be03c793f
2 changed files with 36 additions and 6 deletions
33
.github/workflows/trunk.yml
vendored
33
.github/workflows/trunk.yml
vendored
|
@ -10,6 +10,7 @@ concurrency:
|
||||||
|
|
||||||
permissions:
|
permissions:
|
||||||
contents: write
|
contents: write
|
||||||
|
packages: write
|
||||||
|
|
||||||
jobs:
|
jobs:
|
||||||
build:
|
build:
|
||||||
|
@ -19,12 +20,12 @@ jobs:
|
||||||
name: Build Windows/Linux/MacOS/FreeBSD/Android
|
name: Build Windows/Linux/MacOS/FreeBSD/Android
|
||||||
runs-on: ubuntu-latest
|
runs-on: ubuntu-latest
|
||||||
steps:
|
steps:
|
||||||
- uses: actions/checkout@v3
|
- uses: actions/checkout@v4
|
||||||
with:
|
with:
|
||||||
fetch-depth: 0
|
fetch-depth: 0
|
||||||
|
|
||||||
- name: Set up Go
|
- name: Set up Go
|
||||||
uses: actions/setup-go@v3
|
uses: actions/setup-go@v5
|
||||||
with:
|
with:
|
||||||
go-version: "1.21"
|
go-version: "1.21"
|
||||||
|
|
||||||
|
@ -100,6 +101,7 @@ jobs:
|
||||||
#
|
#
|
||||||
echo "::group::yggstack-linux-i386-static"
|
echo "::group::yggstack-linux-i386-static"
|
||||||
CGO_ENABLED=0 GOOS=linux GOARCH=386 ./build -s -o yggstack-linux-i386-static
|
CGO_ENABLED=0 GOOS=linux GOARCH=386 ./build -s -o yggstack-linux-i386-static
|
||||||
|
CGO_ENABLED=0 GOOS=linux GOARCH=386 ./build -s -o yggstack-linux-386-static
|
||||||
ldd yggstack-linux-i386-static || echo "OK"
|
ldd yggstack-linux-i386-static || echo "OK"
|
||||||
echo "::endgroup::"
|
echo "::endgroup::"
|
||||||
#
|
#
|
||||||
|
@ -143,13 +145,13 @@ jobs:
|
||||||
ldd yggstack-linux-mips64le-static || echo "OK"
|
ldd yggstack-linux-mips64le-static || echo "OK"
|
||||||
echo "::endgroup::"
|
echo "::endgroup::"
|
||||||
#
|
#
|
||||||
echo "::group::yggstack-linux-ppc64"
|
echo "::group::yggstack-linux-ppc64-static"
|
||||||
CGO_ENABLED=0 GOOS=linux GOARCH=ppc64 ./build -s -o yggstack-linux-ppc64
|
CGO_ENABLED=0 GOOS=linux GOARCH=ppc64 ./build -s -o yggstack-linux-ppc64-static
|
||||||
ldd yggstack-linux-ppc64-static || echo "OK"
|
ldd yggstack-linux-ppc64-static || echo "OK"
|
||||||
echo "::endgroup::"
|
echo "::endgroup::"
|
||||||
#
|
#
|
||||||
echo "::group::yggstack-linux-ppc64le"
|
echo "::group::yggstack-linux-ppc64le-static"
|
||||||
CGO_ENABLED=0 GOOS=linux GOARCH=ppc64le ./build -s -o yggstack-linux-ppc64le
|
CGO_ENABLED=0 GOOS=linux GOARCH=ppc64le ./build -s -o yggstack-linux-ppc64le-static
|
||||||
ldd yggstack-linux-ppc64le-static || echo "OK"
|
ldd yggstack-linux-ppc64le-static || echo "OK"
|
||||||
echo "::endgroup::"
|
echo "::endgroup::"
|
||||||
#
|
#
|
||||||
|
@ -260,3 +262,22 @@ jobs:
|
||||||
gh release create trunk --prerelease yggstack-* || gh release upload trunk yggstack-* --clobber
|
gh release create trunk --prerelease yggstack-* || gh release upload trunk yggstack-* --clobber
|
||||||
env:
|
env:
|
||||||
GH_TOKEN: ${{ github.token }}
|
GH_TOKEN: ${{ github.token }}
|
||||||
|
|
||||||
|
- name: Set up Docker Buildx
|
||||||
|
uses: docker/setup-buildx-action@v3
|
||||||
|
|
||||||
|
- name: Login to GitHub Container Registry
|
||||||
|
uses: docker/login-action@v3
|
||||||
|
with:
|
||||||
|
registry: ghcr.io
|
||||||
|
username: ${{ github.actor }}
|
||||||
|
password: ${{ secrets.GITHUB_TOKEN }}
|
||||||
|
|
||||||
|
- name: Build and push yggstack container image
|
||||||
|
uses: docker/build-push-action@v6
|
||||||
|
with:
|
||||||
|
context: .
|
||||||
|
file: Dockerfile.static
|
||||||
|
platforms: linux/386, linux/amd64, linux/arm/v6, linux/arm/v7, linux/arm64, linux/ppc64le, linux/riscv64, linux/s390x
|
||||||
|
push: true
|
||||||
|
tags: ghcr.io/yggdrasil-network/yggstack:trunk
|
||||||
|
|
9
Dockerfile.static
Normal file
9
Dockerfile.static
Normal file
|
@ -0,0 +1,9 @@
|
||||||
|
FROM --platform=linux/amd64 gcr.io/distroless/static
|
||||||
|
|
||||||
|
ARG TARGETOS
|
||||||
|
ARG TARGETARCH
|
||||||
|
ARG TARGETVARIANT
|
||||||
|
|
||||||
|
COPY --chown=0:0 --chmod=0755 yggstack-${TARGETOS}-${TARGETARCH}${TARGETVARIANT}-static /bin/yggstack
|
||||||
|
|
||||||
|
ENTRYPOINT [ "/bin/yggstack" ]
|
Loading…
Add table
Add a link
Reference in a new issue