forked from rstudio/rstudio-docker-products
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Justfile
executable file
·50 lines (40 loc) · 1.52 KB
/
Justfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
set positional-arguments
BUILDX_PATH := ""
IMAGE_PREFIX := "rstudio/"
PRODUCT := "content-base"
IMAGE_OS := "ubuntu1804"
R_VERSION := "3.6.3"
PYTHON_VERSION := "3.9.5"
MINICONDA_VERSION := "4.7.12.1"
QUARTO_VERSION := "1.0.37"
DEFAULT_TAG := IMAGE_PREFIX + PRODUCT + ":r" + R_VERSION + "-py" + PYTHON_VERSION + "-" + IMAGE_OS
# Build content base image - just build ubuntu1804 3.6.3 3.9.5 rstudio/content-base:r3.6.3-py3.9.5-bionic
build OS=IMAGE_OS _R_VERSION=R_VERSION _PYTHON_VERSION=PYTHON_VERSION +TAGS="":
#!/usr/bin/env bash
set -euxo pipefail
BUILDX_ARGS=""
if [[ "{{BUILDX_PATH}}" != "" ]]; then
BUILDX_ARGS="--cache-from=type=local,src=/tmp/.buildx-cache --cache-to=type=local,dest=/tmp/.buildx-cache"
fi
tag_array=()
if [[ "{{TAGS}}" == "" ]]; then
read -a OS_ALIASES <<< $(just -f {{ justfile_directory() }}/../../ci.Justfile _get-os-alias {{OS}})
for os_name in ${OS_ALIASES[@]};
do
tag_array+=(
"-t" "rstudio/{{IMAGE_PREFIX}}{{PRODUCT}}:r{{_R_VERSION}}-py{{_PYTHON_VERSION}}-${os_name}"
)
done
else
for TAG in {{TAGS}}
do
tag_array+=("-t" $TAG)
done
fi
docker buildx --builder="{{ BUILDX_PATH }}" build --load ${BUILDX_ARGS} \
${tag_array[@]} \
--build-arg R_VERSION="{{ _R_VERSION }}" \
--build-arg PYTHON_VERSION="{{ _PYTHON_VERSION }}" \
--build-arg MINICONDA_VERSION="{{ MINICONDA_VERSION }}" \
--build-arg QUARTO_VERSION="{{ QUARTO_VERSION }}" \
--file="Dockerfile.{{ OS }}" {{ justfile_directory() }}