Skip to content

Commit

Permalink
fix devel
Browse files Browse the repository at this point in the history
  • Loading branch information
guocuimi committed May 14, 2024
1 parent 4cbd05e commit 34606f8
Show file tree
Hide file tree
Showing 2 changed files with 11 additions and 9 deletions.
4 changes: 0 additions & 4 deletions docker/Dockerfile.devel
Original file line number Diff line number Diff line change
Expand Up @@ -9,10 +9,6 @@ ENV DEBIAN_FRONTEND noninteractive
COPY ./common/install_base.sh install_base.sh
RUN bash ./install_base.sh && rm install_base.sh

# Install user
COPY ./common/install_user.sh install_user.sh
RUN bash ./install_user.sh && rm install_user.sh

# Install gcc
ARG GCC_VERSION=12
RUN apt-get update \
Expand Down
16 changes: 11 additions & 5 deletions tools/run_in_docker.sh
Original file line number Diff line number Diff line change
Expand Up @@ -62,19 +62,25 @@ RUN_OPTS+=("-v $(pwd):$(pwd)")
RUN_OPTS+=("-v /tmp:/tmp")
RUN_OPTS+=("-v ${HOME}:${HOME}")

# carry over some environment variables
RUN_OPTS+=("-e VCPKG_DEFAULT_BINARY_CACHE=${VCPKG_DEFAULT_BINARY_CACHE}")
RUN_OPTS+=("-e CCACHE_DIR=${CCACHE_DIR}")
# carry over cache settings
if [[ -n "${VCPKG_DEFAULT_BINARY_CACHE}" ]]; then
RUN_OPTS+=("-v ${VCPKG_DEFAULT_BINARY_CACHE}:${VCPKG_DEFAULT_BINARY_CACHE}")
RUN_OPTS+=("-e VCPKG_DEFAULT_BINARY_CACHE=${VCPKG_DEFAULT_BINARY_CACHE}")
fi

if [[ -n "${CCACHE_DIR}" ]]; then
RUN_OPTS+=("-v ${CCACHE_DIR}:${CCACHE_DIR}")
RUN_OPTS+=("-e CCACHE_DIR=${CCACHE_DIR}")
fi

CMD="sh -c 'cd $(pwd); $@'"

[[ "${CMD}" = "" ]] && usage
[[ ! -x $(command -v docker) ]] && echo "ERROR: 'docker' command missing from PATH." && usage

echo "== Pulling docker image: ${IMAGE}"
if ! docker pull ${IMAGE} ; then
echo "WARNING: Failed to docker pull image ${IMAGE}"
fi

echo "docker run ${RUN_OPTS[@]} ${IMAGE} bash -c \"$(get_switch_user_cmd) ${CMD}\""
# echo "docker run ${RUN_OPTS[@]} ${IMAGE} bash -c \"$(get_switch_user_cmd) ${CMD}\""
docker run ${RUN_OPTS[@]} ${IMAGE} bash -c "$(get_switch_user_cmd) ${CMD}"

0 comments on commit 34606f8

Please sign in to comment.