From 41ce547db8791b3403b5b3078b1798bf86f6a2a6 Mon Sep 17 00:00:00 2001 From: Christoph Honal Date: Fri, 14 Feb 2020 18:54:44 +0100 Subject: [PATCH 1/5] Builder unique name --- .drone.yml | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/.drone.yml b/.drone.yml index 820a125..12d8f7b 100644 --- a/.drone.yml +++ b/.drone.yml @@ -15,13 +15,15 @@ steps: path: /var/run/docker.sock commands: - docker run --rm --privileged docker/binfmt:a7996909642ee92942dcd6cff44b9b95f08dad64 - - docker buildx create --use --name crosscomp + - export BUILDER_ID="crosscomp-$(cat /proc/self/cgroup | head -1 | cut -d '/' -f 3)" + - docker buildx create --use --name $BUILDER_ID - docker buildx inspect --bootstrap - docker login --username $DOCKER_USERNAME --password $DOCKER_PASSWORD registry.chrz.de - docker buildx build --platform linux/amd64,linux/arm/v7 --output=type=image,push=true --progress tty --build-arg PROP_SERVER --build-arg PROP_SERVER_USER --build-arg PROP_SERVER_KEY --build-arg PROP_DIR_SDR --build-arg PROP_DIR_DECODER -t registry.chrz.de/redsat/move2docker . + - docker buildx rm $BUILDER_ID environment: PROP_SERVER_USER: from_secret: prop_server_user From f03271d95684f170e0317bf8f557337924f8714e Mon Sep 17 00:00:00 2001 From: Christoph Honal Date: Fri, 14 Feb 2020 19:06:11 +0100 Subject: [PATCH 2/5] Push 1 --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 0e937c3..833ab2c 100644 --- a/README.md +++ b/README.md @@ -11,4 +11,4 @@ This container uses no blobs to build, however some proprietary code is needed. Use the scripts from the `scripts` directory to control the docker containers. Each script takes a parameter to configure the mode, either `gui` or `cli`. ## Configuration -Configure the proprietary code server using the file `config/config.sh` (see or copy `config/config.sh.example*`), and place or link your private key for the server access (`id_rsa`) there as well. Note that this key should not be protected with a password. \ No newline at end of file +Configure the proprietary code server using the file `config/config.sh` (see or copy `config/config.sh.example*`), and place or link your private key for the server access (`id_rsa`) there as well. Note that this key should not be protected with a password. From 3e82bb6d501571e8b482b25d56077ea4e1caa484 Mon Sep 17 00:00:00 2001 From: Christoph Honal Date: Fri, 14 Feb 2020 19:06:24 +0100 Subject: [PATCH 3/5] Remove line --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index 833ab2c..0e937c3 100644 --- a/README.md +++ b/README.md @@ -11,4 +11,4 @@ This container uses no blobs to build, however some proprietary code is needed. Use the scripts from the `scripts` directory to control the docker containers. Each script takes a parameter to configure the mode, either `gui` or `cli`. ## Configuration -Configure the proprietary code server using the file `config/config.sh` (see or copy `config/config.sh.example*`), and place or link your private key for the server access (`id_rsa`) there as well. Note that this key should not be protected with a password. +Configure the proprietary code server using the file `config/config.sh` (see or copy `config/config.sh.example*`), and place or link your private key for the server access (`id_rsa`) there as well. Note that this key should not be protected with a password. \ No newline at end of file From cd241d171eadef88e3183172c96a1eb806ed2640 Mon Sep 17 00:00:00 2001 From: Christoph Honal Date: Fri, 14 Feb 2020 22:51:11 +0100 Subject: [PATCH 4/5] Re-add private cache --- .drone.yml | 2 ++ 1 file changed, 2 insertions(+) diff --git a/.drone.yml b/.drone.yml index 12d8f7b..ca8aae2 100644 --- a/.drone.yml +++ b/.drone.yml @@ -22,6 +22,8 @@ steps: - docker buildx build --platform linux/amd64,linux/arm/v7 --output=type=image,push=true --progress tty --build-arg PROP_SERVER --build-arg PROP_SERVER_USER --build-arg PROP_SERVER_KEY --build-arg PROP_DIR_SDR --build-arg PROP_DIR_DECODER + --cache-to=type=registry,ref=registry.chrz.de/cache/move2docker,mode=max + --cache-from=type=registry,ref=registry.chrz.de/cache/move2docker -t registry.chrz.de/redsat/move2docker . - docker buildx rm $BUILDER_ID environment: From 3aa7def7aaff9afc997f30a35ae64e9b665c9ef1 Mon Sep 17 00:00:00 2001 From: Christoph Honal Date: Sat, 15 Feb 2020 12:46:09 +0100 Subject: [PATCH 5/5] Update Readme & clarify scripts --- README.md | 16 +++++++++++++--- scripts/{build.sh => build-dev.sh} | 2 +- scripts/buildx.sh | 11 ----------- scripts/pull.sh | 2 +- scripts/push.sh | 3 --- scripts/run-dev.sh | 9 +++++++++ scripts/run.sh | 2 +- 7 files changed, 25 insertions(+), 20 deletions(-) rename scripts/{build.sh => build-dev.sh} (83%) delete mode 100644 scripts/buildx.sh delete mode 100644 scripts/push.sh create mode 100644 scripts/run-dev.sh diff --git a/README.md b/README.md index 0e937c3..12b9fe5 100644 --- a/README.md +++ b/README.md @@ -7,8 +7,18 @@ Based on https://github.com/MOVE-II/move2radio. This container uses no blobs to build, however some proprietary code is needed. The distributed docker images only contain binary assets, this is achieved using docker multi-stage builds. The proprietary code is currently hosted at the LRZ GitLab by the MOVE-II team, and an older private mirror exists at the CHRZ Git server. It is forbidden to redistribute the proprietary code without permission, however binary assets compiled from it may be redistributed. -## Usage -Use the scripts from the `scripts` directory to control the docker containers. Each script takes a parameter to configure the mode, either `gui` or `cli`. +## Download +User Docker to download the precompiled binaries: `docker pull registry.chrz.de/redsat/move2docker`. This image is multi-arch and Docker will automatically select the correct sub-image based on the current architecture. -## Configuration +## Usage +Starting the container without any arguments opens a shell into the container. You can override the default entrypoint (`/app/run-cli.sh`) using `docker run --entrypoint "/app/run-gui.sh" ...`, which launches the GNURadio companion on start. The same behavior can be achieved by executing `gnuradio-companion` in the CLI session. + +The GUI container needs to know which X11 server to connect to, this can be configured using `docker run --env DISPLAY=host.docker.internal:0.0 ...` when using Docker Desktop for Windows or OS X. On Linux `host.docker.internal` cannot be resolved so there you have to use something like `$(docker network inspect bridge --format='{{(index .IPAM.Config 0).Gateway}}')` (The gateway address of the `docker0` bridge interface) or its IP address directly like `172.17.0.1`, but note that your configuration may differ. + +## Development +Use the `scripts/*-dev.sh` to build and run the docker container for local development. The other scripts will download and run the precompiled image. + +The public docker image is built by the CI server using the `master` branch of this repository. Please use the `dev` branch for local development. + +### Proprietary Code Server Configuration Configure the proprietary code server using the file `config/config.sh` (see or copy `config/config.sh.example*`), and place or link your private key for the server access (`id_rsa`) there as well. Note that this key should not be protected with a password. \ No newline at end of file diff --git a/scripts/build.sh b/scripts/build-dev.sh similarity index 83% rename from scripts/build.sh rename to scripts/build-dev.sh index 7ceca3e..6319478 100644 --- a/scripts/build.sh +++ b/scripts/build-dev.sh @@ -7,4 +7,4 @@ export PROP_SERVER_KEY=$(cat ./config/id_rsa) docker build \ --build-arg PROP_SERVER --build-arg PROP_SERVER_USER \ --build-arg PROP_SERVER_KEY --build-arg PROP_DIR_SDR --build-arg PROP_DIR_DECODER \ - -t registry.chrz.de/redsat/move2docker:$(arch) . \ No newline at end of file + -t move2docker:dev-$(arch) . \ No newline at end of file diff --git a/scripts/buildx.sh b/scripts/buildx.sh deleted file mode 100644 index a254cdd..0000000 --- a/scripts/buildx.sh +++ /dev/null @@ -1,11 +0,0 @@ -#!/bin/bash - -cd "${0%/*}/.." -source ./config/config.sh -export PROP_SERVER_KEY=$(cat ./config/id_rsa) - -docker buildx build \ - --platform linux/amd64,linux/arm64,linux/arm/v7 \ - --build-arg PROP_SERVER --build-arg PROP_SERVER_USER \ - --build-arg PROP_SERVER_KEY --build-arg PROP_DIR_SDR --build-arg PROP_DIR_DECODER \ - -t registry.chrz.de/redsat/move2docker . \ No newline at end of file diff --git a/scripts/pull.sh b/scripts/pull.sh index a313aa2..3b6b426 100644 --- a/scripts/pull.sh +++ b/scripts/pull.sh @@ -1,3 +1,3 @@ #!/bin/bash -docker pull registry.chrz.de/redsat/move2docker:$(arch) \ No newline at end of file +docker pull registry.chrz.de/redsat/move2docker \ No newline at end of file diff --git a/scripts/push.sh b/scripts/push.sh deleted file mode 100644 index a9e9fec..0000000 --- a/scripts/push.sh +++ /dev/null @@ -1,3 +0,0 @@ -#!/bin/bash - -docker push registry.chrz.de/redsat/move2docker:$(arch) \ No newline at end of file diff --git a/scripts/run-dev.sh b/scripts/run-dev.sh new file mode 100644 index 0000000..4b6c3dc --- /dev/null +++ b/scripts/run-dev.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +cd "${0%/*}/.." +source ./config/config.sh + +docker run -it --rm \ + -v $(pwd)/data:/app/data:rw \ + --env DISPLAY=host.docker.internal:0.0 \ + move2docker:dev-$(arch) \ No newline at end of file diff --git a/scripts/run.sh b/scripts/run.sh index 706ae04..ff339b5 100644 --- a/scripts/run.sh +++ b/scripts/run.sh @@ -6,4 +6,4 @@ source ./config/config.sh docker run -it --rm \ -v $(pwd)/data:/app/data:rw \ --env DISPLAY=host.docker.internal:0.0 \ - registry.chrz.de/redsat/move2docker:$(arch) \ No newline at end of file + registry.chrz.de/redsat/move2docker \ No newline at end of file