
New Pegleg supports feature of pulling git repos. This mount passes SSH keys to the container. Change-Id: I6606ac44469099d8560e89482bba98d7bb9c8dbf
23 lines
543 B
Bash
Executable File
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 "${@}"
|