
This PS bumps ubuntu version to jammy, Golang version to 1.23 and Go modules to fix critical CVEs. Also switched from docker.io to ecr.aws docker repos to fix docker.io ratelimit issue. Change-Id: I630159f4e3520a1fc124172326c7dd14495b0524
39 lines
1.1 KiB
Docker
39 lines
1.1 KiB
Docker
ARG FROM=public.ecr.aws/ubuntu/ubuntu:focal
|
|
ARG GO_IMAGE=public.ecr.aws/docker/library/golang:1.21.1-bullseye
|
|
FROM ${GO_IMAGE} as builder
|
|
|
|
ENV PATH "/usr/local/go/bin:$PATH"
|
|
ENV CGO_ENABLED=0
|
|
WORKDIR /go/src/
|
|
COPY go.mod /go.sum ./
|
|
RUN go mod download
|
|
COPY . ./
|
|
RUN go build -v -o /usr/local/bin/armada-go ./
|
|
|
|
FROM ${FROM} as release
|
|
|
|
LABEL org.opencontainers.image.authors='airship-discuss@lists.airshipit.org, irc://#airshipit@freenode' \
|
|
org.opencontainers.image.url='https://airshipit.org' \
|
|
org.opencontainers.image.documentation='https://docs.airshipit.org/armada-go' \
|
|
org.opencontainers.image.source='https://opendev.org/airship/armada-go' \
|
|
org.opencontainers.image.vendor='The Airship Authors' \
|
|
org.opencontainers.image.licenses='Apache-2.0'
|
|
|
|
ENV DEBIAN_FRONTEND noninteractive
|
|
ENV LANG=C.UTF-8
|
|
ENV LC_ALL=C.UTF-8
|
|
|
|
EXPOSE 8000
|
|
|
|
WORKDIR /armada
|
|
COPY --from=builder /usr/local/bin/armada-go /usr/local/bin/armada
|
|
COPY crd.yaml /armada/crd.yaml
|
|
|
|
# Add armada user
|
|
RUN useradd -u 1000 -g users -d $(pwd) armada
|
|
|
|
ENTRYPOINT ["/usr/local/bin/armada"]
|
|
CMD ["server"]
|
|
|
|
USER armada
|