File tree Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Expand file tree Collapse file tree 2 files changed +7
-2
lines changed Original file line number Diff line number Diff line change @@ -41,7 +41,12 @@ createPersistentDockerDataVolume()
41
41
# shellcheck disable=SC2154
42
42
echo " Removing old volumes and containers"
43
43
# shellcheck disable=SC2046
44
- ${BUILD_CONFIG[DOCKER]} rm -f $( ${BUILD_CONFIG[DOCKER]} ps -a --no-trunc -q -f volume=" ${BUILD_CONFIG[DOCKER_SOURCE_VOLUME_NAME]} " ) || true
44
+ local old_containers=$( ${BUILD_CONFIG[DOCKER]} ps -a --no-trunc -q -f volume=" ${BUILD_CONFIG[DOCKER_SOURCE_VOLUME_NAME]} " )
45
+ if [[ ${old_containers} != " " ]]; then
46
+ ${BUILD_CONFIG[DOCKER]} rm -f $( old_containers) || true
47
+ else
48
+ echo " No old container was found"
49
+ fi
45
50
${BUILD_CONFIG[DOCKER]} volume rm -f " ${BUILD_CONFIG[DOCKER_SOURCE_VOLUME_NAME]} " || true
46
51
47
52
# shellcheck disable=SC2154
Original file line number Diff line number Diff line change @@ -324,7 +324,7 @@ printUserCreate(){
324
324
echo "
325
325
ARG HostUID
326
326
ENV HostUID=\$ HostUID
327
- RUN useradd -u \$ HostUID -ms /bin/bash build
327
+ RUN useradd -o - u \$ HostUID -ms /bin/bash build
328
328
WORKDIR /openjdk/build
329
329
RUN chown -R build /openjdk/
330
330
USER build" >> " $DOCKERFILE_PATH "
You can’t perform that action at this time.
0 commit comments