Skip to content

Commit

Permalink
Fixup MAVEN_CONFIG environment variable to not collide with mvnw wrap…
Browse files Browse the repository at this point in the history
…per (#462)

Fixes #457
  • Loading branch information
bpkroth authored Feb 9, 2024
1 parent 3dc84d9 commit 5a67bf8
Show file tree
Hide file tree
Showing 4 changed files with 9 additions and 7 deletions.
2 changes: 1 addition & 1 deletion .devcontainer/devcontainer.json
Original file line number Diff line number Diff line change
Expand Up @@ -32,7 +32,7 @@
"http_proxy": "${localEnv:http_proxy}",
"https_proxy": "${localEnv:https_proxy}",
"no_proxy": "${localEnv:no_proxy}",
"MAVEN_CONFIG": "${localEnv:HOME}/.m2",
"MAVEN_CONFIG_DIR": "${localEnv:HOME}/.m2",
"LOCAL_WORKSPACE_FOLDER": "${localWorkspaceFolder}",
"CONTAINER_WORKSPACE_FOLDER": "${containerWorkspaceFolder}"
},
Expand Down
4 changes: 2 additions & 2 deletions docker/benchbase/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,9 +75,9 @@ docker pull benchbase.azurecr.io/benchbase-dev
docker run -it --rm -v /path/to/src:/benchbase benchbase.azurecr.io/benchbase-dev
```

> Optional: also reuse the local `MAVEN_CONFIG` and it's repository download cache with the following argument:
> Optional: also reuse the local `MAVEN_CONFIG_DIR` and it's repository download cache with the following argument:
>
> `-v "${MAVEN_CONFIG:-$HOME/.m2}:/home/containeruser/.m2"`
> `-v "${MAVEN_CONFIG_DIR:-$HOME/.m2}:/home/containeruser/.m2"`
```sh
docker pull benchbase.azurecr.io/benchbase
Expand Down
4 changes: 3 additions & 1 deletion docker/benchbase/devcontainer/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,9 @@ RUN groupadd --non-unique --gid ${CONTAINERUSER_GID} containergroup \
&& echo 'containeruser ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
RUN mkdir -p /benchbase/results && chown -R containeruser:containergroup /benchbase/
USER containeruser
ENV MAVEN_CONFIG=/home/containeruser/.m2
# Unset the upstream MVN_CONFIG value - it interacts poorly with the mvnw wrapper.
ENV MAVEN_CONFIG=
ENV MAVEN_CONFIG_DIR=/home/containeruser/.m2
WORKDIR /benchbase
VOLUME /benchbase/results

Expand Down
6 changes: 3 additions & 3 deletions docker/benchbase/run-dev-image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@ else
fi

cd "$rootdir"
MAVEN_CONFIG="${MAVEN_CONFIG:-$HOME/.m2}"
mkdir -p "$MAVEN_CONFIG" || true
MAVEN_CONFIG_DIR="${MAVEN_CONFIG_DIR:-$HOME/.m2}"
mkdir -p "$MAVEN_CONFIG_DIR" || true
set -x
SRC_DIR="${LOCAL_WORKSPACE_FOLDER:-$PWD}"
docker run ${INTERACTIVE_ARGS:-} --rm \
Expand All @@ -39,5 +39,5 @@ docker run ${INTERACTIVE_ARGS:-} --rm \
--env DO_FORMAT_CHECKS="$DO_FORMAT_CHECKS" \
--env EXTRA_MAVEN_ARGS="${EXTRA_MAVEN_ARGS:-}" \
--user "$CONTAINERUSER_UID:$CONTAINERUSER_GID" \
-v "$MAVEN_CONFIG:/home/containeruser/.m2" \
-v "$MAVEN_CONFIG_DIR:/home/containeruser/.m2" \
-v "$SRC_DIR:/benchbase" benchbase-dev:latest $*

0 comments on commit 5a67bf8

Please sign in to comment.