Commit Graph

12 Commits

Author SHA1 Message Date
Jan Kiszka
90ae592ff1 docker: Align also caller's group ID with container
This ensures that both UID and GID of the builder user inside the
container is aligned with the caller of kas-docker - or that of "docker
run" when "-e GROUP_ID=..." is specified.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
2018-11-30 11:15:47 +01:00
Jan Kiszka
6f51c33be2 Docker: Respect --workdir passed to docker run
This avoids

    docker run ... kasproject/kas sh -c "cd /somepath; kas build ..."

and rather allows for

    docker run ... --workdir=/somepath kasproject/kas build ...

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
2018-07-19 09:25:34 +02:00
Jan Kiszka
7bca825059 Docker: Allow to use image like kas command
This adds a bit heuristic to the docker entrypoint in order to move our
API towards "docker run [...] kasproject/kas build kas.yml" - without
breaking existing users. And now you can also do

    docker run --rm kasproject/kas --version

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
2018-07-19 09:25:34 +02:00
Jan Kiszka
ebc2fa7d92 Docker: Consolidate common parts of docker-entrypoint
The GOSU variable now controls whether we run straight (as root) or
via gosu as "builder".

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
2018-07-19 09:25:34 +02:00
Jan Kiszka
47b61d7eca Docker: Fix warning sentence of about aufs
The word "different" was missing.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
2018-07-19 09:25:34 +02:00
Jan Kiszka
cd076101f4 docker: Avoid error messages on container restarts
When the user restarts an already existing kas container, errors are
thrown because of existing folders or users. One example is the usage
of gitlab-ci runners.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
2017-11-22 12:38:07 +01:00
Jan Kiszka
8d5ce95347 docker: Allow to call with USER_ID=0
When we run as root on the host and want to allow the builder to do the
same, e.g. to access root-owned volumes, accept USER_ID=0 to express
this.

This allows to tell the user to call "docker run -e USER_ID=$(id -u)",
and it will always reflect the calling context's permissions into the
container.

Reported-by: Jan Christian Grünhage <jan.christian@gruenhage.xyz>
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
2017-07-21 15:35:05 +02:00
Jan Kiszka
171440c0a1 docker: Start bash if no command is provided
Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
2017-07-20 16:08:34 +02:00
Jan Kiszka
7f1ccba5ea docker: Warn about broken host setup based on aufs
There is a nasty problem with legacy aufs: wic tries to find out the
block size of the filesystem that holds the partition images, but aufs
does not seem to implement this properly, returning 0 at least on Debian
Jessie. That makes wic become upset and through a division-by-zero
exception soon after.

Catch this case by warning the user about the inappropriate docker
setup during container start.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
2017-07-08 16:21:11 +02:00
Jan Kiszka
c9d961f3ee docker: Rename USER_ID variable
Also cosmetic: use a consistent name on the interface as well as
internally.

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
2017-06-19 10:47:02 +02:00
Jan Kiszka
85bec05dd6 docker: Rename user and home dir inside containter
Cosmetic cleanup: call the user and its home dir "builder" as it is an
active entity. This will leave yocto build results under
/builder/build/tmp/deploy/...

Signed-off-by: Jan Kiszka <jan.kiszka@siemens.com>
2017-06-19 10:46:45 +02:00
Daniel Wagner
daf0abab5e Initial public release
This is the first public release of kas.

Signed-off-by: Daniel Wagner <daniel.wagner@siemens.com>
2017-06-14 15:21:19 +02:00