diff mbox series

[v1,02/11] tests/docker: add NOUSER for alpine image

Message ID 20220211160309.335014-3-alex.bennee@linaro.org
State Superseded
Headers show
Series testing/next (docker, lcitool, ci, tcg) | expand

Commit Message

Alex Bennée Feb. 11, 2022, 4:03 p.m. UTC
The alpine image doesn't have a standard useradd binary so disable
this convenience feature for it.

Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
---
 tests/docker/Makefile.include | 3 +++
 1 file changed, 3 insertions(+)

Comments

Daniel P. Berrangé Feb. 11, 2022, 4:23 p.m. UTC | #1
On Fri, Feb 11, 2022 at 04:03:00PM +0000, Alex Bennée wrote:
> The alpine image doesn't have a standard useradd binary so disable
> this convenience feature for it.

Hmm, can you elaborate on the problem here ?

IIUC, the NOUSER env was just about controlling what docker
flags we added. I didn't know it had a dependancy on stuff
inside the image ?

> 
> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> ---
>  tests/docker/Makefile.include | 3 +++
>  1 file changed, 3 insertions(+)
> 
> diff --git a/tests/docker/Makefile.include b/tests/docker/Makefile.include
> index 0ec59b2193..286f0ac5b5 100644
> --- a/tests/docker/Makefile.include
> +++ b/tests/docker/Makefile.include
> @@ -158,6 +158,9 @@ docker-image-debian-native: DOCKER_REGISTRY=
>  docker-image-debian10: NOUSER=1
>  docker-image-debian11: NOUSER=1
>  
> +# alpine has no adduser
> +docker-image-alpine: NOUSER=1
> +
>  #
>  # The build rule for hexagon-cross is special in so far for most of
>  # the time we don't want to build it. While dockers caching does avoid
> -- 
> 2.30.2
> 

Regards,
Daniel
Alex Bennée Feb. 11, 2022, 5:51 p.m. UTC | #2
Daniel P. Berrangé <berrange@redhat.com> writes:

> On Fri, Feb 11, 2022 at 04:03:00PM +0000, Alex Bennée wrote:
>> The alpine image doesn't have a standard useradd binary so disable
>> this convenience feature for it.
>
> Hmm, can you elaborate on the problem here ?
>
> IIUC, the NOUSER env was just about controlling what docker
> flags we added. I didn't know it had a dependancy on stuff
> inside the image ?

The docker.py script expands the dockerfiles with a:

  "RUN id %s 2>/dev/null || useradd -u %d -U %s"

when they are built so when they are invoked for building TCG tests they
won't mess up permissions of the final files. It is a useful convenience
for the other images as well so you can access compilers and tools with
something like:

  docker run --rm -it -u (id -u) -v $HOME:$HOME -w (pwd) qemu/debian-arm64-cross /bin/bash

however it's not required for the normal cross-compile tests as they are
all done inside the docker image. The alpine image being slim doesn't
have this nicety although there is an adduser binary. However given we
don't use alpine for TCG tests I demurred from adding more complexity to
docker.py to handle it.

>
>> 
>> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
>> ---
>>  tests/docker/Makefile.include | 3 +++
>>  1 file changed, 3 insertions(+)
>> 
>> diff --git a/tests/docker/Makefile.include b/tests/docker/Makefile.include
>> index 0ec59b2193..286f0ac5b5 100644
>> --- a/tests/docker/Makefile.include
>> +++ b/tests/docker/Makefile.include
>> @@ -158,6 +158,9 @@ docker-image-debian-native: DOCKER_REGISTRY=
>>  docker-image-debian10: NOUSER=1
>>  docker-image-debian11: NOUSER=1
>>  
>> +# alpine has no adduser
>> +docker-image-alpine: NOUSER=1
>> +
>>  #
>>  # The build rule for hexagon-cross is special in so far for most of
>>  # the time we don't want to build it. While dockers caching does avoid
>> -- 
>> 2.30.2
>> 
>
> Regards,
> Daniel
Daniel P. Berrangé Feb. 11, 2022, 6:08 p.m. UTC | #3
On Fri, Feb 11, 2022 at 05:51:25PM +0000, Alex Bennée wrote:
> 
> Daniel P. Berrangé <berrange@redhat.com> writes:
> 
> > On Fri, Feb 11, 2022 at 04:03:00PM +0000, Alex Bennée wrote:
> >> The alpine image doesn't have a standard useradd binary so disable
> >> this convenience feature for it.
> >
> > Hmm, can you elaborate on the problem here ?
> >
> > IIUC, the NOUSER env was just about controlling what docker
> > flags we added. I didn't know it had a dependancy on stuff
> > inside the image ?
> 
> The docker.py script expands the dockerfiles with a:
> 
>   "RUN id %s 2>/dev/null || useradd -u %d -U %s"
> 
> when they are built so when they are invoked for building TCG tests they
> won't mess up permissions of the final files. It is a useful convenience
> for the other images as well so you can access compilers and tools with
> something like:
> 
>   docker run --rm -it -u (id -u) -v $HOME:$HOME -w (pwd) qemu/debian-arm64-cross /bin/bash
> 
> however it's not required for the normal cross-compile tests as they are
> all done inside the docker image. The alpine image being slim doesn't
> have this nicety although there is an adduser binary. However given we
> don't use alpine for TCG tests I demurred from adding more complexity to
> docker.py to handle it.

Ah, I understand now, so

Reviewed-by: Daniel P. Berrangé <berrange@redhat.com>



> 
> >
> >> 
> >> Signed-off-by: Alex Bennée <alex.bennee@linaro.org>
> >> ---
> >>  tests/docker/Makefile.include | 3 +++
> >>  1 file changed, 3 insertions(+)
> >> 
> >> diff --git a/tests/docker/Makefile.include b/tests/docker/Makefile.include
> >> index 0ec59b2193..286f0ac5b5 100644
> >> --- a/tests/docker/Makefile.include
> >> +++ b/tests/docker/Makefile.include
> >> @@ -158,6 +158,9 @@ docker-image-debian-native: DOCKER_REGISTRY=
> >>  docker-image-debian10: NOUSER=1
> >>  docker-image-debian11: NOUSER=1
> >>  
> >> +# alpine has no adduser
> >> +docker-image-alpine: NOUSER=1
> >> +
> >>  #
> >>  # The build rule for hexagon-cross is special in so far for most of
> >>  # the time we don't want to build it. While dockers caching does avoid
> >> -- 
> >> 2.30.2
> >> 
> >
> > Regards,
> > Daniel
> 
> 
> -- 
> Alex Bennée
> 

Regards,
Daniel
diff mbox series

Patch

diff --git a/tests/docker/Makefile.include b/tests/docker/Makefile.include
index 0ec59b2193..286f0ac5b5 100644
--- a/tests/docker/Makefile.include
+++ b/tests/docker/Makefile.include
@@ -158,6 +158,9 @@  docker-image-debian-native: DOCKER_REGISTRY=
 docker-image-debian10: NOUSER=1
 docker-image-debian11: NOUSER=1
 
+# alpine has no adduser
+docker-image-alpine: NOUSER=1
+
 #
 # The build rule for hexagon-cross is special in so far for most of
 # the time we don't want to build it. While dockers caching does avoid