Files
releases/Dockerfile
T
Torin Sandall 98e7a6f50f Makefile: Update build process to support wasmer
This commit changes a few build settings required for the wasm runtime
integration.

Since wasmer ships as a shared library, it must be distributed with
OPA. Rather than require all users obtain the wasmer shared library,
we continue to publish statically linked OPA executables like we
always have. For the time being, these statically linked executables
will NOT have wasm runtime support available. If users want to
interact with wasm compiled policies, they will either have to do so
via Docker or build OPA themselves.

As part of this change, the Docker images have been updated to be from
gcr.io/distroless/cc (since libc and libgcc are required now) instead
of scratch.

Finally, the build process now produces an extra "opa_docker_$GOARCH"
executable that is used in the Docker image. This executable has the
runpath set so that it can find the wasmer library at runtime.

Signed-off-by: Torin Sandall <torinsandall@gmail.com>
2020-11-06 15:12:38 -05:00

27 lines
767 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 ${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>
# Hack.. https://github.com/moby/moby/issues/37965
# _Something_ needs to be between the two COPY steps.
USER ${USER}
ARG BIN_DIR=.
COPY ${BIN_DIR}/opa_docker_amd64 /opa
COPY ./vendor/github.com/wasmerio/go-ext-wasm/wasmer/libwasmer.so /libwasmer.so
ENTRYPOINT ["/opa"]
CMD ["run"]