-
Notifications
You must be signed in to change notification settings - Fork 519
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
feat: add wolfi based image #12671
Merged
Merged
feat: add wolfi based image #12671
Changes from 10 commits
Commits
Show all changes
11 commits
Select commit
Hold shift + click to select a range
1855fdc
feat: add chainguard dockerfile
kruskall af0fd8a
Merge branch 'main' into feat/chainguard-image
kruskall a62118d
fix: use GOLANG_VERSION build arg to retrieve correct image
kruskall c1eaf84
Merge branch 'main' into feat/chainguard-image
kruskall 6fe932d
Merge branch 'main' into feat/chainguard-image
kruskall b99dfcb
Merge branch 'main' into feat/chainguard-image
kruskall e4cec7e
Merge branch 'main' into feat/chainguard-image
kruskall 76da7c2
Merge branch 'main' into feat/chainguard-image
kruskall 0a58660
Update Dockerfile.chainguard
kruskall f73baae
Merge branch 'main' into feat/chainguard-image
kruskall 953ee3f
Merge branch 'main' into feat/chainguard-image
kruskall File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,87 @@ | ||
FROM docker.elastic.co/wolfi/chainguard-base:20230214 | ||
RUN echo 'TBC' | ||
ARG GOLANG_VERSION | ||
|
||
################################################################################ | ||
# Build stage 0 | ||
# Build the apm-server binary. The golang image version is kept | ||
# up to date with go.mod by Makefile. | ||
################################################################################ | ||
FROM docker.elastic.co/wolfi/go:${GOLANG_VERSION} as builder | ||
WORKDIR /src | ||
COPY go.mod go.sum .go-version /src/ | ||
COPY internal/glog/go.mod /src/internal/glog/go.mod | ||
RUN --mount=type=cache,target=/go/pkg/mod go mod download | ||
COPY Makefile *.mk /src/ | ||
COPY cmd /src/cmd | ||
COPY internal /src/internal | ||
COPY x-pack /src/x-pack | ||
COPY .git /src/.git | ||
COPY script /src/script | ||
|
||
RUN --mount=type=cache,target=/go/pkg/mod \ | ||
--mount=type=cache,target=/root/.cache/go-build \ | ||
make apm-server | ||
|
||
COPY apm-server.yml ./apm-server.yml | ||
COPY --chmod=0644 apm-server.yml ./apm-server.yml | ||
RUN sed -i 's/127.0.0.1:8200/0.0.0.0:8200/' apm-server.yml | ||
RUN sed -i 's/localhost:9200/elasticsearch:9200/' apm-server.yml | ||
|
||
################################################################################ | ||
# Build stage 1 | ||
# Copy prepared files from the previous stage and complete the image. | ||
################################################################################ | ||
FROM cgr.dev/chainguard/static:latest@sha256:288b818c1b3dd89776d176f07f5f671b118fe836c4d80ec2cc3299b596fe71b7 | ||
ARG TARGETARCH | ||
ARG BUILD_DATE | ||
ARG VERSION | ||
ARG VCS_REF | ||
|
||
# Statically defined labels. | ||
LABEL \ | ||
org.label-schema.schema-version="1.0" \ | ||
org.label-schema.vendor="Elastic" \ | ||
org.label-schema.license="Elastic License" \ | ||
org.label-schema.name="apm-server" \ | ||
org.label-schema.url="https://www.elastic.co/apm" \ | ||
org.label-schema.vcs-url="github.com/elastic/apm-server" \ | ||
io.k8s.description="Elastic APM Server" \ | ||
io.k8s.display-name="Apm-Server image" \ | ||
org.opencontainers.image.licenses="Elastic License" \ | ||
org.opencontainers.image.title="Apm-Server" \ | ||
org.opencontainers.image.vendor="Elastic" \ | ||
name="apm-server" \ | ||
maintainer="[email protected]" \ | ||
vendor="Elastic" \ | ||
release="1" \ | ||
url="https://www.elastic.co/apm" \ | ||
summary="apm-server" \ | ||
license="Elastic License" \ | ||
description="Elastic APM Server" | ||
|
||
# Dynamic labels, only set in published images. | ||
LABEL \ | ||
org.label-schema.build-date=${BUILD_DATE} \ | ||
org.label-schema.version=${VERSION} \ | ||
org.label-schema.vcs-ref=${VCS_REF} \ | ||
org.opencontainers.image.created=${BUILD_DATE} \ | ||
version=${VERSION} | ||
|
||
ENV ELASTIC_CONTAINER "true" | ||
|
||
# When running under Docker, we must ensure libbeat monitoring pulls cgroup | ||
# metrics from /sys/fs/cgroup/<subsystem>/, ignoring any paths found in | ||
# /proc/self/cgroup. | ||
ENV LIBBEAT_MONITORING_CGROUPS_HIERARCHY_OVERRIDE=/ | ||
|
||
# Disable libbeat's strict permissions checking, which is not relevant when | ||
# running in Docker. | ||
ENV BEAT_STRICT_PERMS=false | ||
|
||
COPY --chmod=0644 --chown=nonroot:nonroot licenses/ELASTIC-LICENSE-2.0.txt NOTICE.txt /licenses/ | ||
|
||
WORKDIR /usr/share/apm-server | ||
COPY --chmod=0755 --chown=nonroot:nonroot --from=builder /src/apm-server ./apm-server | ||
COPY --chmod=0644 --chown=nonroot:nonroot --from=builder /src/apm-server.yml ./apm-server.yml | ||
|
||
EXPOSE 8200 | ||
ENTRYPOINT ["/usr/share/apm-server/apm-server", "--environment=container"] | ||
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is the default apm-server config file relative?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The config file is copied in the workdir so
/usr/share/apm-server
This is the same behaviour as the current ubuntu-based docker image:
apm-server/packaging/docker/Dockerfile
Line 87 in 76ef6b2