diff --git a/Dockerfile b/Dockerfile index 92659e0..cc1f3d3 100644 --- a/Dockerfile +++ b/Dockerfile @@ -10,24 +10,31 @@ ARG TARGETOS TARGETARCH RUN GOOS=${TARGETOS} GOARCH=${TARGETARCH} CGO_ENABLED=0 go build -o /bin/lazyjournal RUN apk add -U -q --progress --no-cache curl -RUN curl -fsSL https://github.com/tsl0922/ttyd/releases/download/1.7.7/ttyd.x86_64 -o /bin/ttyd -# RUN curl -fsSL https://github.com/containers/podman/releases/latest/download/podman-remote-static-linux_amd64.tar.gz | tar xz -C / -# RUN latest=$(curl -sL https://dl.k8s.io/release/stable.txt) && \ -# curl -fsSL https://cdn.dl.k8s.io/release/$latest/bin/linux/amd64/kubectl -o /bin/kubectl +RUN ARCH=$(case ${TARGETARCH} in \ + "amd64") echo "x86_64" ;; \ + "arm64") echo "aarch64" ;; \ + "arm") echo "armhf" ;; \ + *) echo "${TARGETARCH}" ;; \ + esac) && \ + curl -fsSL "https://github.com/tsl0922/ttyd/releases/download/1.7.7/ttyd.${ARCH}" -o /bin/ttyd && \ + chmod +x /bin/ttyd # Build docker cli FROM golang:1.23-alpine3.20 AS docker-build RUN apk add -U -q --progress --no-cache git bash coreutils gcc musl-dev WORKDIR /go/src/github.com/docker/cli RUN git clone --branch v27.0.3 --single-branch --depth 1 https://github.com/docker/cli . +ARG TARGETOS TARGETARCH ENV CGO_ENABLED=0 -ENV GOARCH=amd64 +ENV GOOS=${TARGETOS} +ENV GOARCH=${TARGETARCH} ENV DISABLE_WARN_OUTSIDE_CONTAINER=1 RUN ./scripts/build/binary -RUN rm build/docker && mv build/docker-linux-* build/docker +RUN rm build/docker && mv build/docker-${TARGETOS}-${TARGETARCH} build/docker -# Final image with systemd +# Final image - используем multi-arch базовый образ FROM debian:bookworm-slim + RUN apt-get update && \ DEBIAN_FRONTEND=noninteractive \ apt-get install -y --no-install-recommends systemd \