Skip to content
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

Alpine ➡️ Distroless as Agones base image #3270

Merged
merged 2 commits into from
Jul 18, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions cmd/allocator/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM alpine:3.14
FROM gcr.io/distroless/static-debian11:nonroot

ARG ARCH=amd64
RUN apk --update add ca-certificates && \
adduser -D -u 1000 agones
WORKDIR /

COPY --chown=agones:agones ./bin/allocator.linux.$ARCH /home/agones/allocator
COPY --chown=agones:agones ./bin/LICENSES ./bin/dependencies-src.tgz /home/agones/
COPY ./bin/allocator.linux.$ARCH /allocator
COPY ./bin/LICENSES .
COPY ./bin/dependencies-src.tgz .

USER 1000
ENTRYPOINT ["/home/agones/allocator"]
USER nonroot:nonroot
Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

A dump question, is this needed if the nonroot image is used?

Copy link
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You know, I always assumed so, but the distroless docs are... not the best 😄 so it's a good question to ask.

We can try and see.

ENTRYPOINT ["/allocator"]
14 changes: 7 additions & 7 deletions cmd/controller/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM alpine:3.14
FROM gcr.io/distroless/static-debian11:nonroot

ARG ARCH=amd64
RUN apk --update add ca-certificates && \
adduser -D -u 1000 agones
WORKDIR /

COPY --chown=agones:agones ./bin/controller.linux.$ARCH /home/agones/controller
COPY --chown=agones:agones ./bin/LICENSES ./bin/dependencies-src.tgz /home/agones/
COPY ./bin/controller.linux.$ARCH /controller
COPY ./bin/LICENSES .
COPY ./bin/dependencies-src.tgz .

USER 1000
ENTRYPOINT ["/home/agones/controller"]
USER nonroot:nonroot
ENTRYPOINT ["/controller"]
14 changes: 7 additions & 7 deletions cmd/extensions/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM alpine:3.14
FROM gcr.io/distroless/static-debian11:nonroot

ARG ARCH=amd64
RUN apk --update add ca-certificates && \
adduser -D -u 1000 agones
WORKDIR /

COPY --chown=agones:agones ./bin/extensions.linux.$ARCH /home/agones/extensions
COPY --chown=agones:agones ./bin/LICENSES ./bin/dependencies-src.tgz /home/agones/
COPY ./bin/extensions.linux.$ARCH /extensions
COPY ./bin/LICENSES .
COPY ./bin/dependencies-src.tgz .

USER 1000
ENTRYPOINT ["/home/agones/extensions"]
USER nonroot:nonroot
ENTRYPOINT ["/extensions"]
14 changes: 7 additions & 7 deletions cmd/ping/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,14 +12,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM alpine:3.14
FROM gcr.io/distroless/static-debian11:nonroot

ARG ARCH=amd64
RUN apk --update add ca-certificates && \
adduser -D -u 1000 agones
WORKDIR /

COPY --chown=agones:agones ./bin/ping.linux.$ARCH /home/agones/ping
COPY --chown=agones:agones ./bin/LICENSES ./bin/dependencies-src.tgz /home/agones/
COPY ./bin/ping.linux.$ARCH /ping
COPY ./bin/LICENSES .
COPY ./bin/dependencies-src.tgz .

USER 1000
ENTRYPOINT ["/home/agones/ping"]
USER nonroot:nonroot
ENTRYPOINT ["/ping"]
15 changes: 8 additions & 7 deletions cmd/sdk-server/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -12,13 +12,14 @@
# See the License for the specific language governing permissions and
# limitations under the License.

FROM alpine:3.14
FROM gcr.io/distroless/static-debian11:nonroot

ARG ARCH=amd64
RUN apk --update add ca-certificates && \
adduser -D -u 1000 agones
WORKDIR /

COPY --chown=agones:agones ./bin/sdk-server.linux.$ARCH /home/agones/sdk-server
COPY --chown=agones:agones ./bin/LICENSES ./bin/dependencies-src.tgz /home/agones/
COPY ./bin/sdk-server.linux.$ARCH /sdk-server
COPY ./bin/LICENSES .
COPY ./bin/dependencies-src.tgz .

USER 1000
ENTRYPOINT ["/home/agones/sdk-server"]
USER nonroot:nonroot
ENTRYPOINT ["/sdk-server"]
6 changes: 3 additions & 3 deletions install/helm/agones/templates/controller.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -148,7 +148,7 @@ spec:
value: {{ .Values.agones.cloudProduct | quote }}
{{- if .Values.agones.controller.persistentLogs }}
- name: LOG_DIR
value: "/home/agones/logs"
value: "/logs"
- name: LOG_SIZE_LIMIT_MB
value: {{ .Values.agones.controller.persistentLogsSizeLimitMB | quote }}
{{- end }}
Expand Down Expand Up @@ -190,11 +190,11 @@ spec:
{{- end }}
volumeMounts:
- name: certs
mountPath: /home/agones/certs
mountPath: /certs
readOnly: true
{{- if .Values.agones.controller.persistentLogs }}
- name: logs
mountPath: /home/agones/logs
mountPath: /logs
readOnly: false
{{- end }}
volumes:
Expand Down
6 changes: 3 additions & 3 deletions install/helm/agones/templates/extensions-deployment.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -120,7 +120,7 @@ spec:
value: {{ .Values.agones.cloudProduct | quote }}
{{- if .Values.agones.extensions.persistentLogs }}
- name: LOG_DIR
value: "/home/agones/logs"
value: "/logs"
- name: LOG_SIZE_LIMIT_MB
value: {{ .Values.agones.extensions.persistentLogsSizeLimitMB | quote }}
{{- end }}
Expand Down Expand Up @@ -167,11 +167,11 @@ spec:
{{- end }}
volumeMounts:
- name: certs
mountPath: /home/agones/certs
mountPath: /certs
readOnly: true
{{- if .Values.agones.extensions.persistentLogs }}
- name: logs
mountPath: /home/agones/logs
mountPath: /logs
readOnly: false
{{- end }}
volumes:
Expand Down
12 changes: 6 additions & 6 deletions install/yaml/install.yaml
Original file line number Diff line number Diff line change
Expand Up @@ -16448,7 +16448,7 @@ spec:
- name: CLOUD_PRODUCT
value: "auto"
- name: LOG_DIR
value: "/home/agones/logs"
value: "/logs"
- name: LOG_SIZE_LIMIT_MB
value: "10000"
- name: POD_NAME
Expand Down Expand Up @@ -16483,10 +16483,10 @@ spec:
ephemeral-storage: 10100Mi
volumeMounts:
- name: certs
mountPath: /home/agones/certs
mountPath: /certs
readOnly: true
- name: logs
mountPath: /home/agones/logs
mountPath: /logs
readOnly: false
volumes:
- name: certs
Expand Down Expand Up @@ -16587,7 +16587,7 @@ spec:
- name: CLOUD_PRODUCT
value: "auto"
- name: LOG_DIR
value: "/home/agones/logs"
value: "/logs"
- name: LOG_SIZE_LIMIT_MB
value: "10000"
- name: POD_NAME
Expand Down Expand Up @@ -16629,10 +16629,10 @@ spec:
ephemeral-storage: 10100Mi
volumeMounts:
- name: certs
mountPath: /home/agones/certs
mountPath: /certs
readOnly: true
- name: logs
mountPath: /home/agones/logs
mountPath: /logs
readOnly: false
volumes:
- name: certs
Expand Down
Loading