File tree Expand file tree Collapse file tree 6 files changed +31
-11
lines changed Expand file tree Collapse file tree 6 files changed +31
-11
lines changed Original file line number Diff line number Diff line change @@ -7,11 +7,14 @@ cd "$scriptdir"
7
7
. ./common-env.sh
8
8
9
9
set -x
10
- # See comments in devcontainer/Dockerfile explaining /dev/null build context.
11
- docker build --progress=plain \
12
- --build-arg=" http_proxy=${http_proxy:- } " --build-arg=" https_proxy=${https_proxy:- } " \
10
+ # See comments in devcontainer/Dockerfile explaining empty build context (/dev/null or empty tmpdir).
11
+ tmpdir=$( mktemp -d)
12
+ docker build $docker_build_args \
13
+ --build-arg BUILDKIT_INLINE_CACHE=1 \
14
+ --build-arg=" http_proxy=${http_proxy:- } " --build-arg=" https_proxy=${https_proxy:- } " --build-arg=" no_proxy=${no_proxy:- } " \
13
15
--build-arg MAVEN_OPTS=" -Dhttp.proxyHost=${http_proxy_host} -Dhttp.proxyPort=${http_proxy_port} -Dhttps.proxyHost=${https_proxy_host} -Dhttps.proxyPort=${https_proxy_port} " \
14
16
--build-arg BENCHBASE_PROFILES=" ${BENCHBASE_PROFILES} " \
15
17
--build-arg CONTAINERUSER_UID=" $CONTAINERUSER_UID " --build-arg CONTAINERUSER_GID=" $CONTAINERUSER_GID " \
16
- --tag benchbase-dev:latest ${image_tag_args:- } -f ./devcontainer/Dockerfile /dev/null
18
+ --tag benchbase-dev:latest ${image_tag_args:- } -f ./devcontainer/Dockerfile " $tmpdir "
19
+ rmdir " $tmpdir "
17
20
set +x
Original file line number Diff line number Diff line change @@ -11,7 +11,7 @@ cd "$scriptdir"
11
11
12
12
if [ " $CLEAN_BUILD " == ' true' ]; then
13
13
grep ' ^FROM ' fullimage/Dockerfile \
14
- | sed -r -e ' s/^FROM\s+//' -e ' s/\s+AS \S+\s*$/ /' \
14
+ | sed -r -e ' s/^FROM\s+//' -e ' s/--platform=\S+\s+// ' -e ' s/ \s+AS \S+\s*$/ /' \
15
15
| while read base_image; do
16
16
set -x
17
17
docker pull $base_image &
@@ -79,8 +79,9 @@ function create_image() {
79
79
local target_image_tag_args=$( echo " -t benchbase:latest ${image_tag_args:- } " | sed " s/benchbase:/$image_name :/g" )
80
80
81
81
set -x
82
- docker build --progress=plain \
83
- --build-arg=" http_proxy=${http_proxy:- } " --build-arg=" https_proxy=${https_proxy:- } " \
82
+ docker build $docker_build_args \
83
+ --build-arg BUILDKIT_INLINE_CACHE=1 \
84
+ --build-arg=" http_proxy=${http_proxy:- } " --build-arg=" https_proxy=${https_proxy:- } " --build-arg=" no_proxy=${no_proxy:- } " \
84
85
--build-arg CONTAINERUSER_UID=" $CONTAINERUSER_UID " --build-arg CONTAINERUSER_GID=" $CONTAINERUSER_GID " \
85
86
$target_image_tag_args -f " $scriptdir /fullimage/Dockerfile" " $scriptdir /fullimage/tmp/"
86
87
set +x
Original file line number Diff line number Diff line change @@ -69,3 +69,17 @@ if [ -n "$git_vers_tag" ]; then
69
69
image_tag_args+=" -t $CONTAINER_REGISTRY_NAME /$imagename :$git_vers_tag "
70
70
fi
71
71
fi
72
+
73
+ docker_build_args=' '
74
+ if ! docker buildx version > /dev/null 2>&1 ; then
75
+ echo ' NOTE: docker buildkit is unavailable.' >&2
76
+ DOCKER_BUILDKIT=0
77
+ docker_build_args=' '
78
+ elif [ -z " $DOCKER_BUILDKIT " ]; then
79
+ # If not already set, default to buildkit.
80
+ DOCKER_BUILDKIT=1
81
+ fi
82
+ if [ " $DOCKER_BUILDKIT " == 1 ]; then
83
+ docker_build_args=' --progress=plain'
84
+ fi
85
+ export DOCKER_BUILDKIT
Original file line number Diff line number Diff line change 1
1
# For the devcontainer we need a full JDK.
2
- FROM --platform=linux maven:3.8.5-eclipse-temurin-17 AS devcontainer
2
+ # FROM --platform=linux maven:3.8.5-eclipse-temurin-17 AS devcontainer
3
+ FROM maven:3.8.5-eclipse-temurin-17 AS devcontainer
3
4
4
5
LABEL org.opencontainers.image.source = "https://github.com/cmu-db/benchbase/"
5
6
Original file line number Diff line number Diff line change 1
1
# Use a smaller base image that only has the jre, not the full jdk.
2
- FROM --platform=linux eclipse-temurin:17-jre AS fullimage
2
+ # FROM --platform=linux eclipse-temurin:17-jre AS fullimage
3
+ FROM eclipse-temurin:17-jre AS fullimage
3
4
4
5
LABEL org.opencontainers.image.source = "https://github.com/cmu-db/benchbase/"
5
6
Original file line number Diff line number Diff line change @@ -9,7 +9,7 @@ rootdir=$(readlink -f "$scriptdir/../../")
9
9
10
10
cd " $scriptdir "
11
11
. ./common-env.sh
12
- ./build-dev-image.sh
12
+ ./build-dev-image.sh >&2
13
13
14
14
if [ " $imagename " != ' benchbase-dev' ]; then
15
15
echo " ERROR: Unexpected imagename: $imagename " >&2
@@ -30,7 +30,7 @@ MAVEN_CONFIG="${MAVEN_CONFIG:-$HOME/.m2}"
30
30
mkdir -p " $MAVEN_CONFIG "
31
31
set -x
32
32
docker run ${INTERACTIVE_ARGS:- } --rm \
33
- --env=http_proxy=" ${http_proxy:- } " --env=https_proxy=" ${https_proxy:- } " \
33
+ --env=http_proxy=" ${http_proxy:- } " --env=https_proxy=" ${https_proxy:- } " --env=no_proxy= " ${no_proxy :- } " \
34
34
--env MAVEN_OPTS=" -Dhttp.proxyHost=${http_proxy_host} -Dhttp.proxyPort=${http_proxy_port} -Dhttps.proxyHost=${https_proxy_host} -Dhttps.proxyPort=${https_proxy_port} " \
35
35
--env BENCHBASE_PROFILES=" $BENCHBASE_PROFILES " \
36
36
--env CLEAN_BUILD=" $CLEAN_BUILD " \
You can’t perform that action at this time.
0 commit comments