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
d4997b07
Commit
d4997b07
authored
6 months ago
by
kaiyou
Browse files
Options
Downloads
Patches
Plain Diff
Rewrite the Dockerfile entirely
parent
7fe53d92
No related branches found
No related tags found
No related merge requests found
Pipeline
#33140
passed
6 months ago
Stage: build
Changes
1
Pipelines
2
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
Dockerfile
+3
-37
3 additions, 37 deletions
Dockerfile
with
3 additions
and
37 deletions
Dockerfile
+
3
−
37
View file @
d4997b07
FROM
golang:1.22
AS
golangbuild
ARG
TARGETARCH
FROM
golang:1.22
WORKDIR
/usr/src/app
COPY
go.mod go.sum ./
RUN
go mod download
&&
go mod verify
COPY
. .
RUN
make
# This builder stage it's only because we need a command
# to create a symlink and reduce the size of the image
FROM
gcr.io/distroless/static-debian11:debug-nonroot
AS
builder
ARG
TARGETARCH
SHELL
["/busybox/sh", "-c"]
COPY
--from=golangbuild --chown=nonroot:nonroot --chmod=0755 /usr/src/app/bin/manager bin/
RUN
ln
-sf
bin/manager_
${
TARGETARCH
}
manager
FROM
gcr.io/distroless/static-debian12:nonroot
ARG
VERSION="dev"
ARG
TARGETARCH
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"
WORKDIR
/
# Needs to copy the entire content, otherwise, it will not
# copy the symlink properly.
COPY
--from=builder /home/nonroot/ .
USER
65532:65532
RUN
make build
\
&&
mv
bin/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