From 4c95ea8c3ad6d6e79d868469508ac437627c3d7a Mon Sep 17 00:00:00 2001 From: Trevor Robinson Date: Thu, 17 Feb 2022 12:08:58 -0600 Subject: [PATCH] Support multiple versions, reduce image size --- Dockerfile | 10 ++++++---- README.md | 24 +++++++++++++++++++++++- 2 files changed, 29 insertions(+), 5 deletions(-) diff --git a/Dockerfile b/Dockerfile index 80367e2..999884b 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,3 +1,7 @@ +ARG metabase_repo=metabase +ARG metabase_version=latest +FROM metabase/${metabase_repo}:${metabase_version} as metabase + # From https://github.com/metabase/metabase/issues/13119#issuecomment-1000350647 FROM ubuntu:21.04 @@ -18,13 +22,11 @@ RUN apt-get update -yq && apt-get install -yq bash fonts-dejavu-core fonts-dejav WORKDIR /app +USER metabase # copy app from the offical image -COPY --from=metabase/metabase:latest /app /app +COPY --from=metabase --chown=metabase /app /app -RUN chown -R metabase /app - -USER metabase # expose our default runtime port EXPOSE 3000 diff --git a/README.md b/README.md index e839ea5..1dc266a 100644 --- a/README.md +++ b/README.md @@ -1,5 +1,27 @@ # metabase-arm64 -arm64-compatible image of [metabase](https://hub.docker.com/r/metabase/metabase) +Multi-arch/arm64-compatible images for [metabase](https://hub.docker.com/r/metabase/metabase) Based on https://github.com/metabase/metabase/issues/13119#issuecomment-1000350647 + +## Building + +### One-time setup + +Need to use a docker driver that supports multiple platforms (otherwise buildx fails with `error: multiple platforms feature is currently not supported for docker driver. Please switch to a different driver (eg. "docker buildx create --use")`). + +``` +docker buildx create --use +``` + +### Building latest + +``` +docker buildx build --push --platform linux/amd64,linux/arm64 --tag scurrilous/metabase:latest . +``` + +### Building a specific repo and/or version + +``` +docker buildx build --push --platform linux/amd64,linux/arm64 --tag scurrilous/metabase:enterprise-v1.41.4 --build-arg metabase_repo=metabase-enterprise --build-arg metabase_version=v1.41.4 . +```