mirror of
https://github.com/bensuperpc/dockcross.git
synced 2024-12-23 09:04:27 +01:00
SSH Support for Git Clone / Checkout
Added SSH support to enable Git checkouts that use SSH instead of HTTP(S). The SSH directory is assumed to be in $HOME/.ssh; however: export SSH_DIR=/my/custom/dir will override the setting and allow for configurable settings. $SSH_DIR is then mounted as host-volume in the Docker container and placed in /home/<user>/.ssh
This commit is contained in:
parent
72b0dfb86d
commit
bf0f74cfd3
@ -24,6 +24,7 @@ RUN apt-get update --yes && apt-get install --no-install-recommends --yes \
|
|||||||
python-pip \
|
python-pip \
|
||||||
rsync \
|
rsync \
|
||||||
sed \
|
sed \
|
||||||
|
ssh \
|
||||||
bison \
|
bison \
|
||||||
flex \
|
flex \
|
||||||
tar \
|
tar \
|
||||||
|
@ -23,5 +23,5 @@ RUN /usr/local/bin/install-python-packages.sh
|
|||||||
|
|
||||||
COPY manylinux-common/pre_exec.sh /dockcross/pre_exec.sh
|
COPY manylinux-common/pre_exec.sh /dockcross/pre_exec.sh
|
||||||
|
|
||||||
RUN yum -y install pax zip \
|
RUN yum -y install pax zip openssh-clients \
|
||||||
&& yum clean all
|
&& yum clean all
|
||||||
|
@ -193,6 +193,16 @@ else
|
|||||||
HOST_PWD=$PWD
|
HOST_PWD=$PWD
|
||||||
fi
|
fi
|
||||||
|
|
||||||
|
# Mount Additional Volumes
|
||||||
|
if [ -z "$SSH_DIR" ]; then
|
||||||
|
SSH_DIR="$HOME/.ssh"
|
||||||
|
fi
|
||||||
|
|
||||||
|
HOST_VOLUMES=
|
||||||
|
if [ -e "$SSH_DIR" ]; then
|
||||||
|
HOST_VOLUMES+="-v $SSH_DIR:/home/$(id -un)/.ssh"
|
||||||
|
fi
|
||||||
|
|
||||||
#------------------------------------------------------------------------------
|
#------------------------------------------------------------------------------
|
||||||
# Now, finally, run the command in a container
|
# Now, finally, run the command in a container
|
||||||
#
|
#
|
||||||
@ -200,6 +210,7 @@ tty -s && TTY_ARGS=-ti || TTY_ARGS=
|
|||||||
CONTAINER_NAME=dockcross_$RANDOM
|
CONTAINER_NAME=dockcross_$RANDOM
|
||||||
docker run $TTY_ARGS --name $CONTAINER_NAME \
|
docker run $TTY_ARGS --name $CONTAINER_NAME \
|
||||||
-v "$HOST_PWD":/work \
|
-v "$HOST_PWD":/work \
|
||||||
|
$HOST_VOLUMES \
|
||||||
$USER_IDS \
|
$USER_IDS \
|
||||||
$FINAL_ARGS \
|
$FINAL_ARGS \
|
||||||
$FINAL_IMAGE "$@"
|
$FINAL_IMAGE "$@"
|
||||||
|
Loading…
Reference in New Issue
Block a user