-
Notifications
You must be signed in to change notification settings - Fork 17
/
Dockerfile
30 lines (19 loc) · 992 Bytes
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
FROM golang:1.21.13-alpine3.20 AS builder
ARG HAWTIO_ONLINE_VERSION=latest
ARG HAWTIO_ONLINE_IMAGE_NAME=quay.io/hawtio/online
ARG HAWTIO_ONLINE_GATEWAY_VERSION=latest
ARG HAWTIO_ONLINE_GATEWAY_IMAGE_NAME=quay.io/hawtio/online-gateway
ENV IMAGE_VERSION_FLAG="-X main.ImageVersion=${HAWTIO_ONLINE_VERSION}"
ENV IMAGE_REPOSITORY_FLAG="-X main.ImageRepository=${HAWTIO_ONLINE_IMAGE_NAME}"
ENV GATEWAY_IMAGE_VERSION_FLAG="-X main.GatewayImageVersion=${HAWTIO_ONLINE_GATEWAY_VERSION}"
ENV GATEWAY_IMAGE_REPOSITORY_FLAG="-X main.GatewayImageRepository=${HAWTIO_ONLINE_GATEWAY_IMAGE_NAME}"
ENV GOLDFLAGS="${IMAGE_VERSION_FLAG} ${IMAGE_REPOSITORY_FLAG} ${GATEWAY_IMAGE_VERSION_FLAG} ${GATEWAY_IMAGE_REPOSITORY_FLAG}"
RUN apk update
RUN apk add git make
WORKDIR /hawtio-operator
COPY . .
RUN GOLDFLAGS=${GOLDFLAGS} make build
FROM alpine:3.18
USER nobody
COPY --from=builder /hawtio-operator/hawtio-operator /usr/local/bin/hawtio-operator
COPY --from=builder /hawtio-operator/config /config