diff --git a/Makefile b/Makefile index 676aa06db49f2879f3a1f7b5a7845091d9483b61..c25f82f5c96e3f4ba95bf034e05c25999b7a3123 100644 --- a/Makefile +++ b/Makefile @@ -186,6 +186,10 @@ config: $(LUA) FORCE $(GLUON_ENV) $(LUA) scripts/target_config_check.lua +container: FORCE + @scripts/container.sh + + all: config +@ $(GLUON_ENV) $(LUA) scripts/clean_output.lua diff --git a/contrib/Dockerfile b/contrib/docker/Dockerfile similarity index 100% rename from contrib/Dockerfile rename to contrib/docker/Dockerfile diff --git a/docs/user/getting_started.rst b/docs/user/getting_started.rst index 7cf008340e1ee2378155ec4f91a568ade181cd69..5d8d6aa2ca66f26a747b8a0c915e258728546de2 100644 --- a/docs/user/getting_started.rst +++ b/docs/user/getting_started.rst @@ -40,6 +40,12 @@ freshly installed Debian Stretch system the following packages are required: * `time` (built-in `time` doesn't work) * `qemu-utils` +We also provide a container environment that already tracks all these dependencies. It quickly gets you up and running, if you already have either Docker or Podman installed locally. + +:: + + ./scripts/container.sh + Building the images ------------------- diff --git a/scripts/container.sh b/scripts/container.sh new file mode 100755 index 0000000000000000000000000000000000000000..c18bf322d1b6e36ef91c026a89723e7eaad238cc --- /dev/null +++ b/scripts/container.sh @@ -0,0 +1,24 @@ +#!/usr/bin/env bash + +set -euo pipefail + +# move into base directory, in case this script is not executed via `make container` +cd "$(dirname "$0")/.." + +# normalize branch name to reflect a valid image name +BRANCH=$(git branch --show-current | sed 's/[^a-z0-9-]/_/ig') +TAG=gluon:${BRANCH} + +if [ "$(command -v podman)" ] +then + podman build -t "${TAG}" contrib/docker + podman run -it --rm --userns=keep-id --volume="$(pwd):/gluon" "${TAG}" +elif [ "$(command -v docker)" ] +then + docker build -t "${TAG}" contrib/docker + docker run -it --rm --volume="$(pwd):/gluon" "${TAG}" +else + 1>&2 echo "Please install either podman or docker. Exiting" >/dev/null + exit 1 +fi +