Files
releases/Dockerfile
T
Torin Sandall e5241112f3 build: Fix image to include ca-certificates from distroless
The scratch base image does not contain ca-certificates which meant
that the version check was failing because of TLS errors while
connecting to telemetry.openpolicyagent.org.

Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2020-05-21 09:22:42 -04:00

23 lines
679 B
Docker

# Copyright 2019 The OPA Authors. All rights reserved.
# Use of this source code is governed by an Apache2
# license that can be found in the LICENSE file.
ARG BASE
FROM gcr.io/distroless/base as certs
FROM ${BASE}
# Any non-zero number will do, and unfortunately a named user will not, as k8s
# pod securityContext runAsNonRoot can't resolve the user ID:
# https://github.com/kubernetes/kubernetes/issues/40958. Make root (uid 0) when
# not specified.
ARG USER=0
MAINTAINER Torin Sandall <torinsandall@gmail.com>
COPY --from=certs /etc/ssl/certs/ca-certificates.crt /etc/ssl/certs/ca-certificates.crt
COPY opa_linux_amd64 /opa
USER ${USER}
ENTRYPOINT ["/opa"]
CMD ["run"]