docker: Add an ENTRYPOINT to run container as debos executable

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 <frederic.danis@collabora.com>
This commit is contained in:
Frédéric Danis
2019-03-25 18:23:30 +01:00
committed by Sjoerd Simons
parent 0ec3327525
commit 9bc3ff0483
3 changed files with 4 additions and 2 deletions

View File

@@ -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"]

View File

@@ -15,7 +15,7 @@ Check that `kvm` is enabled and writable by the user running the docker containe
To build `recipe.yaml`:
```
cd <PATH_TO_RECIPE_DIR>
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 <RECIPE.yaml>
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 <RECIPE.yaml>
```
## Container build

View File

@@ -11,4 +11,4 @@ services:
source: ./tests
target: /recipes
working_dir: /recipes
command: debos simple-recipe.yaml
command: simple-recipe.yaml