Skip to content

Instantly share code, notes, and snippets.

@anderseknert
Created August 25, 2025 19:48
Show Gist options
  • Save anderseknert/734423d3dd2a956286a1c5d90a1e8eea to your computer and use it in GitHub Desktop.
Save anderseknert/734423d3dd2a956286a1c5d90a1e8eea to your computer and use it in GitHub Desktop.
Building and running OPA with the `container` tool
# In the OPA project root directory, first compile the binary
make ci-build-linux-static
# To build the OPA image (use whatever for your tag name)
container build \
--arch arm64 \
--tag myopa.com/opa/opa:latest \
--build-arg BASE=chainguard/glibc-dynamic \
--build-arg BIN_DIR=_release/1.7.0-dev \
--build-arg BIN_SUFFIX=_static \
--file Dockerfile .
# Run it!
# Note that --uid 0 is required for the command to work, as otherwise it'll
# fail for not finding such a user on the host. Not sure how Docker et. al.
# pulls that off, and whether it's planned to work the same here later.
container run --uid 0 --rm --interactive --tty myopa.com/opa/opa:latest
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment