Skip to content

Commit

Permalink
build multiplatform
Browse files Browse the repository at this point in the history
  • Loading branch information
maxheld83 committed Apr 6, 2023
1 parent c4ce8f7 commit 74ff213
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 10 deletions.
8 changes: 5 additions & 3 deletions Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -25,13 +25,15 @@ ifeq ($(is_ci), true)
docker buildx bake \
--file compose.yaml \
--file .env \
--push
--push \
--set=*.platform="linux/arm64,linux/amd64" \
$(bake_args)
else
docker buildx bake \
--file compose.yaml \
--file .env \
--load \
--set=*.cache-to="type=inline"
--set=*.cache-to="type=inline" \
$(bake_args)
endif

.DEFAULT_GOAL := show-help
Expand Down
27 changes: 20 additions & 7 deletions onbuild.Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,24 @@
FROM rstudio/r-base:4.1.1-focal AS base
# stuff used in all downstream stages (builder and prod)
# syntax=docker/dockerfile:1.4

# below have to be in sync with above base image
# there seems to be no better way; cannot persist env vars based on running scripts
ENV R_HOME="/opt/R/4.1.1/lib/R"
# this freezes r dependencies see https://github.com/maxheld83/muggle/issues/60
ENV RSPM="https://packagemanager.rstudio.com/all/__linux__/focal/2021-11-23+MTo2NDY5MDY1LDI6NDUyNjIxNTs4NTZEODU0QQ"
# bump this to bust the cache
ARG BUST_CACHE=1

FROM ubuntu:jammy AS base

SHELL ["/bin/bash", "-c"]
RUN set -o pipefail
ARG DEBIAN_FRONTEND=noninteractive

# default place to mount or copy project source
ARG SOURCE_MOUNT_PATH=/root/source/
ENV SOURCE_MOUNT_PATH=$SOURCE_MOUNT_PATH
RUN mkdir --parents $SOURCE_MOUNT_PATH

RUN apt-get update && \
apt-get install --yes --no-install-recommends --allow-downgrades \
# needed for makefile
git-all=1:2.34.1-1ubuntu1.8 \
make=4.3-4.1build1

FROM base AS intermediary
# TODO remove when migrated to rspm https://github.com/maxheld83/muggle/issues/25
Expand Down

0 comments on commit 74ff213

Please sign in to comment.