pegleg/tools/pegleg.sh
Kaspars Skels ac6297eae6 Add ~/.ssh mount to pegleg.sh
New Pegleg supports feature of pulling git repos.
This mount passes SSH keys to the container.

Change-Id: I6606ac44469099d8560e89482bba98d7bb9c8dbf
2018-09-07 10:31:35 -05:00

23 lines
543 B
Bash
Executable File

#!/usr/bin/env bash
set -e
: ${WORKSPACE:=$(pwd)}
: ${IMAGE:=quay.io/airshipit/pegleg:latest}
echo
echo "== NOTE: Workspace $WORKSPACE is the execution directory in the container =="
echo
# Working directory inside container to execute commands from and mount from
# host OS
container_workspace_path='/workspace'
docker run --rm -it \
--net=host \
--workdir="$container_workspace_path" \
-v "${HOME}/.ssh:${container_workspace_path}/.ssh" \
-v "${WORKSPACE}:$container_workspace_path" \
"${IMAGE}" \
pegleg "${@}"