mirror of
https://github.com/psviderski/uncloud.git
synced 2026-08-26 11:03:34 +00:00
update dind machine image to run dockerd in background
This commit is contained in:
@@ -4,6 +4,7 @@
|
||||
# Allow files and directories.
|
||||
!cmd/
|
||||
!internal/
|
||||
!scripts/docker-entrypoint.sh
|
||||
!go.*
|
||||
|
||||
# Ignore unnecessary files inside allowed directories.
|
||||
|
||||
+14
-3
@@ -3,6 +3,13 @@ FROM golang:1.23.2-alpine AS uncloudd
|
||||
ARG TARGETOS
|
||||
ARG TARGETARCH
|
||||
|
||||
ENV CGO_ENABLED=0
|
||||
|
||||
WORKDIR /build
|
||||
# Download and cache dependencies and only redownload them in subsequent builds if they change.
|
||||
COPY go.mod go.sum ./
|
||||
RUN go mod download && go mod verify
|
||||
|
||||
COPY . .
|
||||
RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} go build -o uncloudd cmd/uncloudd/main.go
|
||||
|
||||
@@ -15,15 +22,19 @@ RUN wget -q -O /tmp/corrosion.tar.gz \
|
||||
&& rm /tmp/corrosion.tar.gz /tmp/corrosion
|
||||
|
||||
FROM chainguard/wolfi-base:latest AS corrosion
|
||||
# TODO: create uncloud user
|
||||
COPY --from=corrosion-download /usr/local/bin/corrosion /usr/local/bin/corrosion
|
||||
CMD ["corrosion", "agent"]
|
||||
|
||||
|
||||
FROM docker:27.3.1-dind
|
||||
FROM docker:27.3.1-dind AS machine
|
||||
RUN apk --no-cache add \
|
||||
wireguard-tools
|
||||
# Create system group and user 'uncloud'.
|
||||
RUN addgroup -S uncloud && adduser -SHD -h /nonexistent -G uncloud -g "" uncloud
|
||||
COPY --from=uncloudd /go/uncloudd /usr/local/bin/uncloudd
|
||||
|
||||
COPY scripts/docker-entrypoint.sh /usr/local/bin/
|
||||
COPY --from=uncloudd /build/uncloudd /usr/local/bin/
|
||||
# TODO: socat to forward uncloud.sock unix socket?
|
||||
|
||||
ENTRYPOINT ["docker-entrypoint.sh"]
|
||||
CMD ["uncloudd"]
|
||||
|
||||
Executable
+6
@@ -0,0 +1,6 @@
|
||||
#!/bin/sh
|
||||
set -eu
|
||||
|
||||
dind dockerd &
|
||||
|
||||
exec "$@"
|
||||
Reference in New Issue
Block a user