Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
CloudNative-PG
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Service Desk
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
TeDomum
CloudNative-PG
Commits
27c4b75c
Commit
27c4b75c
authored
2 weeks ago
by
kaiyou
Browse files
Options
Downloads
Patches
Plain Diff
Rewrite the Dockerfile again
parent
d16695f9
No related branches found
No related tags found
No related merge requests found
Pipeline
#36069
passed
2 weeks ago
Stage: build
Changes
1
Pipelines
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Dockerfile
+13
-20
13 additions, 20 deletions
Dockerfile
with
13 additions
and
20 deletions
Dockerfile
+
13
−
20
View file @
27c4b75c
FROM
golang:1.23
as
builder
ARG
VERSION="dev"
FROM
golang:1.23
as
gobuild
WORKDIR
/usr/src/app
ENV
CGO_ENABLED=0
ENV
GO111MODULE=on
...
...
@@ -7,26 +6,20 @@ COPY go.mod go.sum ./
RUN
go mod download
&&
go mod verify
COPY
. .
RUN
make build-manager
\
&&
mv
bin/manager /manager_amd64
&&
mkdir
-p
/dist/manager
\
&&
mv
bin/manager /dist/manager/manager_amd64
FROM
alpine:latest
ARG
VERSION="dev"
ENV
SUMMARY="CloudNativePG Operator Container Image." \
DESCRIPTION="This Docker image contains CloudNativePG Operator."
LABEL
summary="$SUMMARY" \
description="$DESCRIPTION" \
io.k8s.display-name="$SUMMARY" \
io.k8s.description="$DESCRIPTION" \
name="CloudNativePG Operator" \
vendor="CloudNativePG Contributors" \
url="https://cloudnative-pg.io/" \
version="$VERSION" \
release="1"
# This builder stage it's only because we need a command
# to create a symlink and we do not have it in a distroless image
FROM
gcr.io/distroless/static-debian12:debug-nonroot
AS
builder
SHELL
["/busybox/sh", "-c"]
RUN
ln
-sf
operator/manager_amd64 manager
FROM
gcr.io/distroless/static-debian12:nonroot
WORKDIR
/
RUN
apk
--no-cache
add ca-certificates tzdata
COPY
--from=gobuild --chown=nonroot:nonroot --chmod=0755 /dist/manager/* operator/
COPY
--from=builder /home/nonroot/ .
COPY
licenses /licenses
COPY
LICENSE /licenses
COPY
--from=builder /manager_amd64 /bin/
RUN
ln
-sf
/bin/manager_amd64 manager
USER
65532:65532
ENTRYPOINT
[
"/manager"
]
ENTRYPOINT
["/manager"]
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment