From 9bc3ff048331b236642f501707ca355d597cc352 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Fr=C3=A9d=C3=A9ric=20Danis?= Date: Mon, 25 Mar 2019 18:23:30 +0100 Subject: [PATCH] docker: Add an ENTRYPOINT to run container as debos executable MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The ENTRYPOINT set the image’s main command, allowing that image to be run as though it was that command. With 'docker run', the command parameters could be passed directly after the container's name. Signed-off-by: Frédéric Danis --- docker/Dockerfile | 2 ++ docker/README.md | 2 +- docker/recipes.test.yml | 2 +- 3 files changed, 4 insertions(+), 2 deletions(-) diff --git a/docker/Dockerfile b/docker/Dockerfile index 013bcdd..384ec8e 100644 --- a/docker/Dockerfile +++ b/docker/Dockerfile @@ -74,3 +74,5 @@ RUN apt-get update && \ rm -rf /var/lib/apt/lists/* COPY --from=builder $GOPATH/bin/debos /usr/local/bin/debos + +ENTRYPOINT ["/usr/local/bin/debos"] diff --git a/docker/README.md b/docker/README.md index 19292d4..508132e 100644 --- a/docker/README.md +++ b/docker/README.md @@ -15,7 +15,7 @@ Check that `kvm` is enabled and writable by the user running the docker containe To build `recipe.yaml`: ``` cd -docker run --rm --interactive --tty --device /dev/kvm --user $(id -u) --workdir /recipes --mount "type=bind,source=$(pwd),destination=/recipes" --security-opt label=disable godebos/debos debos +docker run --rm --interactive --tty --device /dev/kvm --user $(id -u) --workdir /recipes --mount "type=bind,source=$(pwd),destination=/recipes" --security-opt label=disable godebos/debos ``` ## Container build diff --git a/docker/recipes.test.yml b/docker/recipes.test.yml index 0370569..18d4aca 100644 --- a/docker/recipes.test.yml +++ b/docker/recipes.test.yml @@ -11,4 +11,4 @@ services: source: ./tests target: /recipes working_dir: /recipes - command: debos simple-recipe.yaml + command: simple-recipe.yaml