-
Notifications
You must be signed in to change notification settings - Fork 27
/
Dockerfile.agent
59 lines (44 loc) · 1.77 KB
/
Dockerfile.agent
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
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
ARG GOLANG_BUILDER=golang:1.21
ARG OPERATOR_BASE_IMAGE=gcr.io/distroless/base
# Build the manager binary
FROM $GOLANG_BUILDER AS builder
#Arguments required by OSBS build system
ARG CACHITO_ENV_FILE=/remote-source/cachito.env
ARG REMOTE_SOURCE=.
ARG REMOTE_SOURCE_DIR=/remote-source
ARG REMOTE_SOURCE_SUBDIR=
ARG DEST_ROOT=/dest-root
ARG WHAT=osp-director-agent
ARG GO_BUILD_EXTRA_ARGS=
COPY $REMOTE_SOURCE $REMOTE_SOURCE_DIR
WORKDIR $REMOTE_SOURCE_DIR/$REMOTE_SOURCE_SUBDIR
RUN if [ -f $CACHITO_ENV_FILE ] ; then source $CACHITO_ENV_FILE ; fi ; CGO_ENABLED=1 go build ${GO_BUILD_EXTRA_ARGS} -o ${DEST_ROOT}/${WHAT} ./containers/agent
# Use distroless as minimal base image to package the manager binary
# Refer to https://github.com/GoogleContainerTools/distroless for more details
FROM $OPERATOR_BASE_IMAGE
# Those arguments must match ones from builder
ARG DEST_ROOT=/dest-root
ARG WHAT=osp-director-agent
ARG IMAGE_COMPONENT="osp-director-agent-container"
ARG IMAGE_NAME="osp-director-agent"
ARG IMAGE_VERSION="1.4.0"
ARG IMAGE_SUMMARY="OSP-Director-Operator-agent"
ARG IMAGE_DESC="This is agent that works with the OSP Director Operator"
ARG IMAGE_TAGS="openstack director"
### DO NOT EDIT LINES BELOW
# Auto generated using CI tools from
# https://github.com/openstack-k8s-operators/openstack-k8s-operators-ci
# Labels required by upstream and osbs build system
LABEL com.redhat.component="${IMAGE_COMPONENT}" \
name="${IMAGE_NAME}" \
version="${IMAGE_VERSION}" \
summary="${IMAGE_SUMMARY}" \
io.k8s.name="${IMAGE_NAME}" \
io.k8s.description="${IMAGE_DESC}" \
io.openshift.tags="${IMAGE_TAGS}"
### DO NOT EDIT LINES ABOVE
WORKDIR /
# Install binary to WORKDIR
COPY --from=builder ${DEST_ROOT}/${WHAT} .
ENV PATH="/:${PATH}"
ENTRYPOINT ["/osp-director-agent"]