Skip to content

Commit 8145788

Browse files
committed
run_sdk_container: Allow mounting custom volumes into SDK container
1 parent 6b32674 commit 8145788

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

run_sdk_container

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -18,10 +18,11 @@ custom_image=""
1818
tty=()
1919
remove=""
2020
cleanup=""
21+
mounts=()
2122

2223
usage() {
2324
echo " Usage:"
24-
echo " $0 [-t] [-v <version>] [-V <SDK version>] [-a <amd64|arm64|all>] [-n <name> ] [-x <script>] [-C <custom-container>] [--rm] [-U] [<container-command>]"
25+
echo " $0 [-t] [-v <version>] [-V <SDK version>] [-a <amd64|arm64|all>] [-n <name> ] [-x <script>] [-C <custom-container>] [--rm] [-U] [-m <src>:<dest>] [<container-command>]"
2526
echo " Start an SDK container of a given SDK release version."
2627
echo " This will create the container if it does not exist, otherwise start the existing container."
2728
echo " If the container is already running then it will exec into the container."
@@ -46,6 +47,8 @@ usage() {
4647
echo " $sdk_container_common_registry/flatcar-sdk-[ARCH]:[SDK VERSION]."
4748
echo " Useful for CI."
4849
echo " -U Do not update the versionfile. Instead, use the version from the versionfile as-is."
50+
echo " -m <src>:<dest> - Mount local file or directory inside the container."
51+
echo " Can be specified multiple times."
4952
echo " -h Print this help."
5053
echo
5154
}
@@ -68,6 +71,7 @@ while [[ $# -gt 0 ]] ; do
6871
os_version=$(get_version_from_versionfile)
6972
update_versionfile=
7073
shift;;
74+
-m) mounts+=( -v "$2" ); shift; shift;;
7175
*) break;;
7276
esac
7377
done
@@ -138,6 +142,7 @@ if [[ -z ${stat} ]] ; then
138142
-v "${PWD}/__build__/images:/mnt/host/source/src/build"
139143
-v "${PWD}:/mnt/host/source/src/scripts"
140144
"${gpg_volumes[@]}"
145+
"${mounts[@]}"
141146
--privileged
142147
--network host
143148
-e SDK_USER_ID="$(id -u)"

0 commit comments

Comments
 (0)