Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Failed to launch in azure-pipelines microsoft hosted environment with Ubuntu-22.04 #15

Open
miurahr opened this issue Oct 29, 2023 · 4 comments

Comments

@miurahr
Copy link

miurahr commented Oct 29, 2023

When launching amke/innosetup:64bit-buster on azure-pipelines with a command line like

umask a+w
exec docker run -i -rm -u `id -u`:`id -g` -v "$PWD":/work amake/innosetup:64bit-buster  build/innosetup/OmegaT.iss

It always failed with

wine: /home/xclient/.wine is not owned by you
wine: /home/xclient/.wine is not owned by you
@miurahr
Copy link
Author

miurahr commented Oct 29, 2023

It works well in my local Mint Linux 21.2 environment with nerdctl and docker client ver 24.0.5.

@amake
Copy link
Owner

amake commented Oct 29, 2023

My guess is that -u `id -u`:`id -g` makes the user/group mismatch in Azure, whereas in your local environment the user and group IDs do match by coincidence.

Fundamentally this is the same as #7

@miurahr
Copy link
Author

miurahr commented Nov 11, 2023

/etc/passwd

xclient:x:1000:101:user for running an xclient application,,,:/home/xclient:/bin/bash

/home/xclient

drwxr-xr-x 1 xclient xusers 4096 Nov 11 22:23 .wine

/etc/group

xusers:x:101:

when run on my desktop containerd/nerdctl without root permission, executed environment uid/gid = 1000/1000

@miurahr
Copy link
Author

miurahr commented Nov 12, 2023

Now I hope this works

PUID=`id -u`
PGID=`id -g`
IMAGE=omegatorg/innosetup:innosetup6

cat << __EOF__ | docker build -t $IMAGE - || true
FROM docker.io/amake/innosetup:innosetup6-buster
#
USER root
RUN usermod -u $PUID -o xclient && groupmod -g $PGID -o xusers
RUN chown -R $PUID:$PGID /home/xclient /work
#
USER xclient
ENV HOME /home/xclient
ENV WINEPREFIX /home/xclient/.wine
ENV WINEARCH win32
WORKDIR /work
ENTRYPOINT ["iscc"]
__EOF__

docker run -i --rm   -u `id -u`:`id -g`  -v "$PWD":/work  $IMAGE $ISS

test

When running docker with 1000:1000 environment, I observes

drwxr-xr-x 1 xclient xusers 4096 Nov 12 00:01 .wine
xclient:x:1000:1000:user for running an xclient application,,,:/home/xclient:/bin/bash
xusers:x:1000:

This is an evidence groupmod works. It will work when usermod effective. I'd like to try it on azure-pipelines.
Docker image don't have any user who has uid > 1000, so there will be no congestion in uid.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants