abuild-sdk/abuild: docker image with `podman`/`buildah` wrongly determine user groups
abuild
says abuild-apk: User me is not a member of group abuild
but it is!
┌─[ me@b86f258cb58b ] [09:23:09] ~/aports/community/ocaml
└> > abuild -r
>>> ocaml: Building community/ocaml 4.08.1-r0 (using abuild 3.4.0-r1) started Thu, 31 Oct 2019 09:23:10 +0000
>>> ocaml: Checking sanity of /home/me/aports/community/ocaml/APKBUILD...
>>> ocaml: Analyzing dependencies...
abuild-apk: User me is not a member of group abuild
>>> ERROR: ocaml: builddeps failed
>>> ocaml: Uninstalling dependencies...
abuild-apk: User me is not a member of group abuild
┌─[ me@0ae06b50b392 ] [09:26:00] ~
└> > sudo groups me
me : abuild user
┌─[ me@0ae06b50b392 ] [09:26:04] ~
└> > groups
abuild
┌─[ me@0ae06b50b392 ] [09:26:08] ~
└> > groups me
me : abuild user
┌─[ me@0ae06b50b392 ] [09:27:02] ~
└> > id
uid=1000(me) gid=300(abuild) groups=300(abuild)
See the relevant Dockerfile piece:
# Some variables
ARG username=me
ARG realname="Some User"
ARG email="some.user@gmail.com"
FROM alpine:edge
MAINTAINER ${realname} <${email}>
# Enable "testing" repository
RUN echo "http://dl-cdn.alpinelinux.org/alpine/edge/testing" >> \
/etc/apk/repositories
RUN apk add --no-cache alpine-sdk bash bash-doc bash-completion
# Setting up the user
RUN addgroup -g 1000 -S user && \
adduser -u 1000 -D -S ${username} -G abuild && \
addgroup ${username} user
RUN echo "${username} ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
USER ${username}
WORKDIR /home/${username}
ENTRYPOINT ["/bin/bash"]
Attaching the complete minimal Dockerfile and a buildscript: alpine.zip