Files
babashka-pod-docker/Dockerfile

27 lines
865 B
Docker
Raw Normal View History

2023-08-21 12:20:35 +01:00
FROM golang:1.21-alpine AS build
2023-08-18 17:24:16 +01:00
RUN apk --no-cache add git openssh-client
2023-08-18 17:21:02 +01:00
2023-08-18 17:22:53 +01:00
ENV GOPRIVATE=github.com/docker
RUN mkdir -p -m 0600 ~/.ssh && ssh-keyscan github.com >> ~/.ssh/known_hosts
2023-08-18 18:10:13 +01:00
RUN --mount=type=secret,id=gitghatoken ( git config --global url."https://x-access-token:$(cat /run/secrets/gitghatoken)@github.com/docker".insteadOf "https://github.com/docker")
2023-08-18 17:22:53 +01:00
WORKDIR /app
COPY go.mod ./
COPY go.sum ./
2023-08-18 18:10:13 +01:00
RUN GOPRIVATE=github.com/docker go mod download
COPY main.go ./
COPY docker/ ./docker/
COPY babashka/ ./babashka/
2023-02-15 13:54:36 +00:00
RUN CGO_ENABLED=0 go build -ldflags "-s -w" -o babashka-pod-docker
FROM alpine:3.17
2023-02-09 13:26:42 +00:00
ARG version
COPY repository/ /root/.babashka/pods/repository
2023-05-03 16:39:08 +01:00
COPY --from=build /app/babashka-pod-docker /root/.babashka/pods/repository/docker/docker-tools/0.1.0
RUN chmod 755 /root/.babashka/pods/repository/docker/docker-tools/0.1.0/babashka-pod-docker