Merge pull request #138 from conz27/ssh_support

SSH Support for Git Clone / Checkout
This commit is contained in:
Matt McCormick 2017-05-13 11:04:25 -04:00 committed by GitHub
commit 68962e0e84
3 changed files with 13 additions and 1 deletions

View File

@ -24,6 +24,7 @@ RUN apt-get update --yes && apt-get install --no-install-recommends --yes \
python-pip \
rsync \
sed \
ssh \
bison \
flex \
tar \

View File

@ -18,5 +18,5 @@ RUN /usr/local/bin/install-python-packages.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

View File

@ -193,6 +193,16 @@ else
HOST_PWD=$PWD
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
#
@ -200,6 +210,7 @@ tty -s && TTY_ARGS=-ti || TTY_ARGS=
CONTAINER_NAME=dockcross_$RANDOM
docker run $TTY_ARGS --name $CONTAINER_NAME \
-v "$HOST_PWD":/work \
$HOST_VOLUMES \
$USER_IDS \
$FINAL_ARGS \
$FINAL_IMAGE "$@"