mirror of
https://github.com/psviderski/uncloud.git
synced 2026-08-26 11:03:34 +00:00
chore: build a use new corrosion image 2026.5.14 (pointing to v1.0.0 upstream) for ucind
This commit is contained in:
+9
-5
@@ -18,6 +18,7 @@ RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -o uncloudd ./cmd/uncloudd
|
|||||||
|
|
||||||
FROM alpine:${ALPINE_VERSION} AS corrosion-download
|
FROM alpine:${ALPINE_VERSION} AS corrosion-download
|
||||||
ARG TARGETARCH
|
ARG TARGETARCH
|
||||||
|
ARG CORROSION_VERSION
|
||||||
|
|
||||||
RUN CORROSION_ARCH=$(case "${TARGETARCH}" in \
|
RUN CORROSION_ARCH=$(case "${TARGETARCH}" in \
|
||||||
"amd64") echo "x86_64" ;; \
|
"amd64") echo "x86_64" ;; \
|
||||||
@@ -25,20 +26,21 @@ RUN CORROSION_ARCH=$(case "${TARGETARCH}" in \
|
|||||||
*) echo "Architecture '${TARGETARCH}' not supported" >&2 && exit 1 ;; \
|
*) echo "Architecture '${TARGETARCH}' not supported" >&2 && exit 1 ;; \
|
||||||
esac) \
|
esac) \
|
||||||
&& wget -q -O /tmp/corrosion.tar.gz \
|
&& wget -q -O /tmp/corrosion.tar.gz \
|
||||||
"https://github.com/psviderski/corrosion/releases/latest/download/corrosion-${CORROSION_ARCH}-unknown-linux-gnu.tar.gz" \
|
"https://github.com/psviderski/corrosion/releases/download/v${CORROSION_VERSION}/corrosion-${CORROSION_ARCH}-unknown-linux-gnu.tar.gz" \
|
||||||
&& tar -xzf /tmp/corrosion.tar.gz -C /tmp \
|
&& tar -xzf /tmp/corrosion.tar.gz -C /tmp \
|
||||||
&& install /tmp/corrosion /usr/local/bin/corrosion \
|
&& install /tmp/corrosion /usr/bin/corrosion \
|
||||||
&& rm /tmp/corrosion.tar.gz /tmp/corrosion
|
&& rm /tmp/corrosion.tar.gz /tmp/corrosion
|
||||||
|
|
||||||
# Beware that more modern images like chainguard/wolfi-base build glibc with flags that require newer CPU features,
|
# Beware that more modern images like chainguard/wolfi-base build glibc with flags that require newer CPU features,
|
||||||
# e.g. x86-64-v2. So such image may fail with "Fatal glibc error: CPU does not support x86-64-v2" on older CPUs.
|
# e.g. x86-64-v2. So such image may fail with "Fatal glibc error: CPU does not support x86-64-v2" on older CPUs.
|
||||||
FROM gcr.io/distroless/cc-debian12:latest AS corrosion
|
FROM gcr.io/distroless/cc-debian13:latest AS corrosion
|
||||||
COPY --from=corrosion-download /usr/local/bin/corrosion /usr/local/bin/corrosion
|
COPY --from=corrosion-download /usr/bin/corrosion /usr/bin/corrosion
|
||||||
CMD ["corrosion", "agent"]
|
CMD ["corrosion", "agent"]
|
||||||
|
|
||||||
|
|
||||||
FROM alpine:${ALPINE_VERSION} AS corrosion-image-tarball
|
FROM alpine:${ALPINE_VERSION} AS corrosion-image-tarball
|
||||||
ARG CORROSION_IMAGE="ghcr.io/psviderski/corrosion:latest"
|
ARG CORROSION_VERSION
|
||||||
|
ARG CORROSION_IMAGE="ghcr.io/unlabs-dev/corrosion:${CORROSION_VERSION}"
|
||||||
ARG TARGETOS
|
ARG TARGETOS
|
||||||
ARG TARGETARCH
|
ARG TARGETARCH
|
||||||
|
|
||||||
@@ -47,6 +49,8 @@ RUN crane pull --platform ${TARGETOS}/${TARGETARCH} "${CORROSION_IMAGE}" /corros
|
|||||||
|
|
||||||
# Uncloud-in-Docker (ucind) image for running Uncloud test clusters using Docker.
|
# Uncloud-in-Docker (ucind) image for running Uncloud test clusters using Docker.
|
||||||
FROM docker:29.4.0-dind AS ucind
|
FROM docker:29.4.0-dind AS ucind
|
||||||
|
ARG CORROSION_VERSION
|
||||||
|
|
||||||
# Create system group and user 'uncloud'.
|
# Create system group and user 'uncloud'.
|
||||||
RUN addgroup -S uncloud && adduser -SHD -h /nonexistent -G uncloud -g "" uncloud
|
RUN addgroup -S uncloud && adduser -SHD -h /nonexistent -G uncloud -g "" uncloud
|
||||||
RUN apk --no-cache add \
|
RUN apk --no-cache add \
|
||||||
|
|||||||
@@ -1,6 +1,7 @@
|
|||||||
# TODO: Makefile is deprecated, add new targets as mise tasks in mise.toml instead.
|
# TODO: Makefile is deprecated, add new targets as mise tasks in mise.toml instead.
|
||||||
|
|
||||||
CORROSION_IMAGE ?= ghcr.io/psviderski/corrosion:latest
|
CORROSION_VERSION ?= 2026.5.14
|
||||||
|
CORROSION_IMAGE = ghcr.io/unlabs-dev/corrosion:$(CORROSION_VERSION)
|
||||||
UCIND_IMAGE ?= ghcr.io/psviderski/ucind:latest
|
UCIND_IMAGE ?= ghcr.io/psviderski/ucind:latest
|
||||||
|
|
||||||
.PHONY: ucind-cluster
|
.PHONY: ucind-cluster
|
||||||
@@ -9,11 +10,12 @@ ucind-cluster:
|
|||||||
|
|
||||||
.PHONY: corrosion-image
|
.PHONY: corrosion-image
|
||||||
corrosion-image:
|
corrosion-image:
|
||||||
docker build -t "$(CORROSION_IMAGE)" --target corrosion .
|
docker build --build-arg CORROSION_VERSION=$(CORROSION_VERSION) -t "$(CORROSION_IMAGE)" --target corrosion .
|
||||||
|
|
||||||
.PHONY: corrosion-multiarch-image-push
|
.PHONY: corrosion-multiarch-image-push
|
||||||
corrosion-multiarch-image-push:
|
corrosion-multiarch-image-push:
|
||||||
docker buildx build --push --platform linux/amd64,linux/arm64 -t "$(CORROSION_IMAGE)" --target corrosion .
|
docker buildx build --build-arg CORROSION_VERSION=$(CORROSION_VERSION) --push --platform linux/amd64,linux/arm64 \
|
||||||
|
-t "$(CORROSION_IMAGE)" --target corrosion .
|
||||||
|
|
||||||
.PHONY: ucind-multiarch-image-push
|
.PHONY: ucind-multiarch-image-push
|
||||||
ucind-multiarch-image-push:
|
ucind-multiarch-image-push:
|
||||||
|
|||||||
@@ -16,9 +16,8 @@ import (
|
|||||||
"github.com/docker/docker/client"
|
"github.com/docker/docker/client"
|
||||||
)
|
)
|
||||||
|
|
||||||
const (
|
// Image is the Corrosion image pinned to the uncloudd release.
|
||||||
LatestImage = "ghcr.io/psviderski/corrosion:latest"
|
const Image = "ghcr.io/unlabs-dev/corrosion:2026.5.14"
|
||||||
)
|
|
||||||
|
|
||||||
type DockerService struct {
|
type DockerService struct {
|
||||||
Client *client.Client
|
Client *client.Client
|
||||||
|
|||||||
@@ -131,7 +131,7 @@ func (c *Config) SetDefaults() (*Config, error) {
|
|||||||
|
|
||||||
cfg.CorrosionService = &corroservice.DockerService{
|
cfg.CorrosionService = &corroservice.DockerService{
|
||||||
Client: cfg.DockerClient,
|
Client: cfg.DockerClient,
|
||||||
Image: corroservice.LatestImage,
|
Image: corroservice.Image,
|
||||||
Name: "uncloud-corrosion",
|
Name: "uncloud-corrosion",
|
||||||
DataDir: cfg.CorrosionDir,
|
DataDir: cfg.CorrosionDir,
|
||||||
User: fmt.Sprintf("%d:%d", uid, gid),
|
User: fmt.Sprintf("%d:%d", uid, gid),
|
||||||
|
|||||||
@@ -12,6 +12,7 @@ protoc-gen-go = "1.34.2"
|
|||||||
protoc-gen-go-grpc = "1.5.1"
|
protoc-gen-go-grpc = "1.5.1"
|
||||||
|
|
||||||
[vars]
|
[vars]
|
||||||
|
corrosion_version = "2026.5.14"
|
||||||
ucind_image = "ghcr.io/psviderski/ucind:latest"
|
ucind_image = "ghcr.io/psviderski/ucind:latest"
|
||||||
|
|
||||||
[env]
|
[env]
|
||||||
@@ -56,7 +57,7 @@ run = "go run ./cmd/ucind"
|
|||||||
|
|
||||||
[tasks."ucind:image"]
|
[tasks."ucind:image"]
|
||||||
description = "Build the ucind Docker image"
|
description = "Build the ucind Docker image"
|
||||||
run = "docker build -t {{vars.ucind_image}} --target ucind ."
|
run = "docker build --build-arg CORROSION_VERSION={{vars.corrosion_version}} -t {{vars.ucind_image}} --target ucind ."
|
||||||
|
|
||||||
[tasks."ucind:cleanup"]
|
[tasks."ucind:cleanup"]
|
||||||
description = "Remove ucind managed containers and networks"
|
description = "Remove ucind managed containers and networks"
|
||||||
|
|||||||
Reference in New Issue
Block a user