Skip to content

Commit

Permalink
container: to easily access the running container
Browse files Browse the repository at this point in the history
Just to avoid doing a 'docker ps' and 'docker exec' manually.

Signed-off-by: Matthieu Baerts (NGI0) <[email protected]>
  • Loading branch information
matttbe committed Dec 2, 2024
1 parent b1f576f commit 5447416
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 4 deletions.
7 changes: 3 additions & 4 deletions connect.sh
Original file line number Diff line number Diff line change
@@ -1,9 +1,8 @@
#! /bin/bash
# SPDX-License-Identifier: GPL-2.0
DIR="$(dirname "$(realpath -P "${0}")")"

if [[ "${-}" =~ "x" ]]; then
export INPUT_TRACE=1
fi
docker exec -it \
-e "INPUT_TRACE=${INPUT_TRACE:-0}" \
"$(docker ps --filter "label=name=mptcp-upstream-virtme-docker" -l --format "{{.ID}}")" \
/entrypoint.sh connect "${@}"
bash "-${-}" "${DIR}/container.sh" /entrypoint.sh connect "${@}"
7 changes: 7 additions & 0 deletions container.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#! /bin/bash
# SPDX-License-Identifier: GPL-2.0

docker exec -it \
-e "INPUT_TRACE=${INPUT_TRACE:-0}" \
"$(docker ps --filter "label=name=mptcp-upstream-virtme-docker" -l --format "{{.ID}}")" \
"${@:-bash}"

0 comments on commit 5447416

Please sign in to comment.