[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-trivial] [RFC PATCH for 2.10 35/35] script to run docker image
From: |
Philippe Mathieu-Daudé |
Subject: |
[Qemu-trivial] [RFC PATCH for 2.10 35/35] script to run docker image |
Date: |
Mon, 24 Jul 2017 15:27:51 -0300 |
Signed-off-by: Philippe Mathieu-Daudé <address@hidden>
---
scripts/dockershell | 30 ++++++++++++++++++++++++++++++
1 file changed, 30 insertions(+)
create mode 100755 scripts/dockershell
diff --git a/scripts/dockershell b/scripts/dockershell
new file mode 100755
index 0000000000..f6a2276172
--- /dev/null
+++ b/scripts/dockershell
@@ -0,0 +1,30 @@
+#! /bin/sh
+
+# This script starts a docker shell with QEMU directory mounted
+#
+# Copyright (C) 2017 Philippe Mathieu-Daudé. GPLv2+.
+#
+# Usage:
+# ./scripts/dockershell qemu:debian-bleeding-dev
+
+if [ $# -lt 1 ]; then
+ echo
+ echo "error: missing image name"
+ echo
+ docker images qemu --no-trunc --format="- {{.Repository}}:{{.Tag}}"
+ exit 1
+fi
+
+SDIR=$(cd "$(dirname "$0")/.." && pwd -P)
+CDIR=$(pwd -P)
+
+VOLS="-v /tmp:/tmp"
+if [ "${SDIR}" = "${CDIR}" ]; then
+ VOLS="${VOLS} -v ${SDIR}:${SDIR} -w ${SDIR}"
+else
+ VOLS="${VOLS} -v ${SDIR}:${SDIR}:ro -v ${CDIR}:${CDIR} -w ${CDIR}"
+fi
+
+docker run --rm -it ${VOLS} \
+ -u $(id -u) \
+ $1
--
2.13.3
- Re: [Qemu-trivial] [PATCH for 2.10 26/35] linux-user: use is_error() to avoid warnings and make the code clearer, (continued)
Re: [Qemu-trivial] [PATCH for 2.10 00/35] fix bugs reported by Clang Static Analyzer, Peter Maydell, 2017/07/24