Open abhisekp opened 1 year ago
Does your user have write permission for the directory you are running in?
@andydotxyz Yes, /home/abhisek/go/src/my-app
has the user permission because it's inside the home dir. And my app dir.
As evident, these dirs are cleaned.
[✓] "bin" dir cleaned: /home/abhisek/go/src/my-app/fyne-cross/bin/linux-amd64
[✓] "dist" dir cleaned: /home/abhisek/go/src/my-app/fyne-cross/dist/linux-amd64
[✓] "temp" dir cleaned: /home/abhisek/go/src/my-app/fyne-cross/tmp/linux-amd64
@andydotxyz the error is from inside the container. Which directory does it map to in the host sytem?
Which directory does it map to in the host sytem?
The current directory, by default. Maybe your disk ran out of space? Or Docker is running as a user who cannot write to your files?
The clearing of old builds message isn't proof it can write, as if they were missing it wouldn't have to do anything.
@andydotxyz @Jacalz My current user has all the permissions. And I'm able to run helloworld docker. But with fyne it throws this error.
This is the output of id
command. As you can see 1003
the current user and while running docker, that user is given permission in the docker container. And obviously, my current user has the appropriate permissions.
▶ id
uid=1003(abhisek) gid=998(docker) groups=998(docker),27(sudo),139(libvirt),1003(abhisek)
My disk has a lot of space too
▶ df -h /
Filesystem Size Used Avail Use% Mounted on
/dev/sda9 122G 110G 6.8G 95% /
Can you please help me settings these things manually? I will create a custom docker and would like fyne-cross use that instead?
I think it is not a docker image problem, but that docker doesn't have access to your app subdirectory. You can try the following command to check:
/usr/bin/docker run --rm -t -w /app -v /home/abhisek/go/src/my-app:/app:z -u 1003:1003 --entrypoint fixuid -e CGO_ENABLED=1 -e GOCACHE=/go/go-build -e CC=gcc -e CGO_LDFLAGS=-w -s -e GOOS=linux -e GOARCH=amd64 docker.io/fyneio/fyne-cross:1.3-base mkdir -p /app/fyne-cross/bin/linux-amd64/ && touch /app/fyne-cross/bin/linux-amd64/MY_APP
@Bluebugs That's throwing an error
touch: cannot touch '/app/fyne-cross/bin/linux-amd64/MY_APP': No such file or directory
@Bluebugs This is the full output
▶ /usr/bin/docker run --rm -t -w /app -v /home/abhisek/go/src/my-app:/app:z -u 1003:1003 --entrypoint fixuid -e CGO_ENABLED=1 -e GOCACHE=/go/go-build -e CC=gcc -e CGO_LDFLAGS='-w -s' -e GOOS=linux -e GOARCH=amd64 docker.io/fyneio/fyne-cross:1.3-base sh -c "mkdir -p fyne-cross/bin/linux-amd64 && touch fyne-cross/bin/linux-amd64/MY_APP"
fixuid: fixuid should only ever be used on development systems. DO NOT USE IN PRODUCTION
fixuid: updating user 'docker' to UID '1003'
fixuid: updating group 'docker' to GID '1003'
fixuid: recursively searching path /
fixuid: chown /home/docker
fixuid: chown /home/docker/.bash_logout
fixuid: chown /home/docker/.bashrc
fixuid: chown /home/docker/.profile
touch: cannot touch 'fyne-cross/bin/linux-amd64/MY_APP': Permission denied
@Bluebugs But this command works fine without the -u 1003:1003 --entrypoint fixuid
/usr/bin/docker run --rm -t -w /app -v /home/abhisek/go/src/my-app:/app:z -e CGO_ENABLED=1 -e GOCACHE=/go/go-build -e CC=gcc -e CGO_LDFLAGS='-w -s' -e GOOS=linux -e GOARCH=amd64 docker.io/fyneio/fyne-cross:1.3-base sh -c "mkdir -p fyne-cross/bin/linux-amd64 && touch fyne-cross/bin/linux-amd64/MY_APP"
A file is created properly.
My docker version
▶ docker -v
Docker version 20.10.22, build 3a2c30b
That's interesting. @lucor, I think you have a better knowledge here than I do, any guess what could be going on?
running in a project idx workspace. rootless docker. I had to do the following at various stages
chmod 777 -R fyne-cross/ # inside MY-APP-FOLDER
chmod 777 MY-APP-FOLDER # inside my home
chmod 777 -R /home/user/.cache/fyne-cross
This still results in
[i] Target: windows/amd64
[i] Cleaning target directories...
[✓] "bin" dir cleaned: /app/fyne-cross/bin/windows-amd64
[✓] "dist" dir cleaned: /app/fyne-cross/dist/windows-amd64
[✓] "temp" dir cleaned: /app/fyne-cross/tmp/windows-amd64
[i] Checking for go.mod: /home/user/myapp/MY-APP-FOLDER/go.mod
[✓] go.mod found
[i] Packaging app...
adding: MY-APP-FOLDER.exe (deflated 47%)
[✗] rename /home/user/myapp/MY-APP-FOLDER/fyne-cross/tmp/windows-amd64/MY-APP-FOLDER.exe.zip /home/user/myapp/MY-APP-FOLDER/fyne-cross/dist/windows-amd64/MY-APP-FOLDER.exe.zip: permission denied
While last step failed, I still got the output zip file. This seems like docker shenanigans. fyne-cross's docker images are not properly doing the sub-uid/gid stuff. Maybe you guys are using rootful docker so doesn't get affected by these. I use podman (which is by default rootless) in my own pc, so can't provide more insight. But It has been my experience that people assume rootful docker when building container images and those images craps out when it doesn't have that whole rootful docker permissions.
We are definitely not supporting rootless docker. Only podman rootless is supported. Is that the case here, we are talking about rootless docker?
It could be that because your user isn't 1000 you are getting issues. I've had issues with docker container permissions before where containers only work if your uid is 1000.
Describe the bug:
To Reproduce:
Steps to reproduce the behaviour:
Device and debug info (please complete the following information):
Debug info