Skip to content

Commit 5447416

Browse files
committed
container: to easily access the running container
Just to avoid doing a 'docker ps' and 'docker exec' manually. Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
1 parent b1f576f commit 5447416

File tree

2 files changed

+10
-4
lines changed

2 files changed

+10
-4
lines changed

connect.sh

+3-4
Original file line numberDiff line numberDiff line change
@@ -1,9 +1,8 @@
11
#! /bin/bash
2+
# SPDX-License-Identifier: GPL-2.0
3+
DIR="$(dirname "$(realpath -P "${0}")")"
24

35
if [[ "${-}" =~ "x" ]]; then
46
export INPUT_TRACE=1
57
fi
6-
docker exec -it \
7-
-e "INPUT_TRACE=${INPUT_TRACE:-0}" \
8-
"$(docker ps --filter "label=name=mptcp-upstream-virtme-docker" -l --format "{{.ID}}")" \
9-
/entrypoint.sh connect "${@}"
8+
bash "-${-}" "${DIR}/container.sh" /entrypoint.sh connect "${@}"

container.sh

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#! /bin/bash
2+
# SPDX-License-Identifier: GPL-2.0
3+
4+
docker exec -it \
5+
-e "INPUT_TRACE=${INPUT_TRACE:-0}" \
6+
"$(docker ps --filter "label=name=mptcp-upstream-virtme-docker" -l --format "{{.ID}}")" \
7+
"${@:-bash}"

0 commit comments

Comments
 (0)