Skip to content

Commit 71ec711

Browse files
authored
feat: set base image to 24.04 lts (#4)
2 parents 9c44817 + d32337c commit 71ec711

File tree

7 files changed

+674
-28
lines changed

7 files changed

+674
-28
lines changed

.env

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
GIT_CHGLOG_VERSION=v0.15.0
22
OSXCROSS_VERSION=v12.0.0
33
DEBIAN_FRONTEND=noninteractive
4-
DPKG_ARCH="amd64 arm64 armel armhf i386 mips mipsel powerpc ppc64el s390x"
5-
CROSSBUILD_ARCH="amd64 arm64 armel armhf mipsel ppc64el s390x"
4+
DPKG_ARCH="amd64 arm64 armel armhf i386 mips mipsel powerpc ppc64el s390x riscv64"
5+
CROSSBUILD_ARCH="amd64 arm64 armel armhf i386 mipsel ppc64el s390x riscv64"

.github/workflows/release.yaml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
---
12
name: release
23
on:
34
push:
@@ -9,30 +10,30 @@ jobs:
910
runs-on: ubuntu-latest
1011
steps:
1112
- name: Login to GitHub Container Registry
12-
uses: docker/login-action@v2
13+
uses: docker/login-action@v3
1314
with:
1415
registry: ghcr.io
1516
username: ${{ github.repository_owner }}
1617
password: ${{ secrets.GITHUB_TOKEN }}
1718
- name: Checkout code
18-
uses: actions/checkout@v3
19+
uses: actions/checkout@v5
1920
- run: git fetch --prune --unshallow
2021
- name: Setup env
2122
uses: c-py/action-dotenv-to-setenv@v3
2223
with:
2324
env-file: .env
2425
- name: Set up QEMU
25-
uses: docker/setup-qemu-action@v2
26+
uses: docker/setup-qemu-action@v3
2627
- name: Set up Docker Buildx
27-
uses: docker/setup-buildx-action@v2
28+
uses: docker/setup-buildx-action@v3
2829
- name: Install cosign
2930
uses: sigstore/cosign-installer@main
3031
- uses: actions/setup-go@v3
3132
with:
3233
go-version: "${{ env.GO_VERSION }}"
3334
- name: Docker meta
3435
id: meta
35-
uses: docker/metadata-action@v4
36+
uses: docker/metadata-action@v5
3637
with:
3738
images: ghcr.io/goreleaser/goreleaser-cross-toolchains
3839
tags: |

Dockerfile

Lines changed: 14 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1,17 +1,22 @@
11
ARG DEBIAN_FRONTEND=noninteractive
22
ARG APT_MIRROR
3-
ARG OSXCROSS_VERSION
3+
ARG OSXCROSS_VERSION="v12.0.0"
44

55
FROM ghcr.io/goreleaser/goreleaser-osxcross:$OSXCROSS_VERSION AS osxcross
66

7-
FROM debian:bullseye AS base
7+
FROM ubuntu:noble AS base
8+
9+
ARG TARGETARCH
10+
COPY ubuntu.sources /etc/apt/sources.list.d/ubuntu.sources
811

912
ARG TARGETARCH
1013
ARG DPKG_ARCH
1114
ARG CROSSBUILD_ARCH
12-
ARG OSXCROSS_PATH=/osxcross
15+
ARG OSX_CROSS_PATH=/usr/local/osxcross
1316
ARG MINGW_VERSION=20230130
14-
ARG MINGW_HOST="ubuntu-18.04"
17+
ARG MINGW_HOST="ubuntu-22.04"
18+
19+
ENV DEBIAN_FRONTEND="noninteractive"
1520

1621
LABEL maintainer="Artur Troian <troian dot ap at gmail dot com>"
1722
LABEL "org.opencontainers.image.source"="https://github.com/goreleaser/goreleaser-cross-toolchains"
@@ -32,7 +37,7 @@ RUN \
3237
autoconf \
3338
automake \
3439
bc \
35-
python \
40+
python3 \
3641
jq \
3742
binfmt-support \
3843
binutils-multiarch \
@@ -54,7 +59,7 @@ RUN \
5459
libarchive-tools \
5560
gdb \
5661
mingw-w64 \
57-
${crossbuild_pkgs}\
62+
${crossbuild_pkgs} \
5863
&& apt -y autoremove \
5964
&& apt-get clean \
6065
&& rm -rf /var/lib/apt/lists/* \
@@ -63,9 +68,10 @@ RUN \
6368
&& rm -rf /usr/share/man/* \
6469
/usr/share/doc \
6570
&& MINGW_ARCH=$(echo -n $TARGETARCH | sed -e 's/arm64/aarch64/g' | sed -e 's/amd64/x86_64/g') \
71+
&& cd /usr/local \
6672
&& wget -qO - "https://github.com/mstorsjo/llvm-mingw/releases/download/${MINGW_VERSION}/llvm-mingw-${MINGW_VERSION}-ucrt-${MINGW_HOST}-${MINGW_ARCH}.tar.xz" | bsdtar -xf - \
6773
&& ln -snf $(pwd)/llvm-mingw-${MINGW_VERSION}-ucrt-${MINGW_HOST}-${MINGW_ARCH} /llvm-mingw
6874

69-
COPY --from=osxcross "${OSXCROSS_PATH}" "${OSXCROSS_PATH}"
75+
COPY --from=osxcross "${OSX_CROSS_PATH}" "${OSX_CROSS_PATH}"
7076

71-
ENV PATH=${OSX_CROSS_PATH}/bin:$PATH
77+
ENV PATH=$PATH:"$OSX_CROSS_PATH/bin"

Makefile

Lines changed: 22 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,35 +1,38 @@
11
include .env
22

3-
REGISTRY ?= ghcr.io
3+
REGISTRIES ?= ghcr.io \
4+
docker.io
5+
6+
SUBIMAGES ?= arm64 \
7+
amd64
8+
9+
TOOLS := ./scripts/tools.sh
10+
411
TAG_VERSION ?= $(shell git describe --tags --abbrev=0)
5-
IMAGE_NAME := goreleaser/goreleaser-cross-toolchains:$(TAG_VERSION)
612

7-
ifneq ($(REGISTRY),)
8-
IMAGE_NAME := $(REGISTRY)/$(IMAGE_NAME)
9-
endif
13+
IMAGE_NAMES := $(shell $(TOOLS) generate tags cross-toolchains $(TAG_VERSION) "$(REGISTRIES)")
1014

1115
DOCKER_BUILD=docker build
1216

13-
SUBIMAGES ?= amd64 \
14-
arm64
17+
SUBIMAGES ?= arm64 \
18+
amd64
1519

1620
.PHONY: gen-changelog
1721
gen-changelog:
1822
@echo "generating changelog to changelog"
1923
./scripts/genchangelog.sh $(shell git describe --tags --abbrev=0) changelog.md
2024

21-
.PHONY: toolchain-%
22-
toolchain-%:
23-
@echo "building $(IMAGE_NAME)-$(@:toolchain-%=%)"
24-
$(DOCKER_BUILD) --platform=linux/$(@:toolchain-%=%) -t $(IMAGE_NAME)-$(@:toolchain-%=%) \
25+
.PHONY: toolchains-%
26+
toolchains-%:
27+
$(DOCKER_BUILD) --platform=linux/$* $(foreach IMAGE,$(IMAGE_NAMES), -t $(IMAGE)-$*) \
2528
--build-arg DPKG_ARCH=$(DPKG_ARCH) \
2629
--build-arg CROSSBUILD_ARCH=$(CROSSBUILD_ARCH) \
2730
--build-arg OSXCROSS_VERSION="$(OSXCROSS_VERSION)" \
2831
--build-arg DEBIAN_FRONTEND=$(DEBIAN_FRONTEND) \
2932
-f Dockerfile .
3033

3134
.PHONY: toolchains
32-
toolchains: $(patsubst %, toolchain-%,$(SUBIMAGES))
35+
toolchains: $(patsubst %, toolchains-%,$(SUBIMAGES))
3336

3437
.PHONY: docker-push-%
3538
docker-push-%:
@@ -41,7 +44,9 @@ docker-push: $(patsubst %, docker-push-%,$(SUBIMAGES))
4144
.PHONY: manifest-create
4245
manifest-create:
4346
@echo "creating manifest $(IMAGE_NAME)"
44-
docker manifest create $(IMAGE_NAME) $(foreach arch,$(SUBIMAGES), --amend $(IMAGE_NAME)-$(arch))
47+
docker manifest rm $(IMAGE_NAME) 2>/dev/null || true
48+
docker manifest create $(IMAGE_NAME) \
49+
$(foreach arch,$(SUBIMAGES), $(shell docker inspect $(IMAGE_NAME)-$(arch) | jq -r '.[].RepoDigests | .[0]'))
4550

4651
.PHONY: manifest-push
4752
manifest-push:
@@ -55,3 +60,7 @@ tags:
5560
.PHONY: tag
5661
tag:
5762
@echo $(TAG_VERSION)
63+
64+
.PHONY: release
65+
release: toolchains docker-push manifest-create manifest-push
66+

0 commit comments

Comments
 (0)