"Permission denied" when building the Docker image during SDK installation

Hello,

I am currently trying to setup the SDK under an openSUSE Tumbleweed VM. Since I am already inside VirtualBox, I picked Docker during install.

However, the installation failed on the image building step with the following error:

+ tar -C /srv/mer --numeric-owner -xpf /host_install/mersdk/sailfish-tools.tar.xz

tar: /host_install/mersdk/sailfish-tools.tar.xz: Cannot open: Permission denied

At this point, I was thinking to try connecting directly inside the container so I can fix the permission problem by hand and run the command again, but I fail doing so:

$ docker run sailfish-sdk-build-engine:gbaudic
Setup incomplete. Refer to Sailfish SDK FAQ

Any tips on how to solve this issue would be greatly appreciated. I am not that much familiar with Docker, though. I can also provide more information if needed.

For reference, the full log of the Docker build step:

#0 building with "default" instance using docker driver

#1 [internal] load build definition from Dockerfile
#1 transferring dockerfile: 632B done
#1 DONE 0.1s


#2 [internal] load .dockerignore
#2 transferring context: 2B done
#2 DONE 0.1s


#3 [internal] load build context

#3 transferring context: 213.72MB 2.6s done

#3 DONE 12.5s


#4 [1/2] ADD sailfish.tar.xz /

#4 DONE 51.0s


#5 [2/2] RUN chown -R --from=mersdk "1000" /etc/mersdk /home/mersdk;     usermod -u "1000" mersdk

#5 DONE 1.6s



#6 exporting to image
#6 exporting layers

#6 exporting layers 151.8s done

#6 exporting manifest sha256:9176573b21016f2486d9af0d44ac161592107e324200ff21d48845a33565b652 0.0s done
#6 exporting config sha256:05858339c779dc0f73fb4cbc60b969b2efa09749fb07d261567d66c40d3fc365 0.0s done
#6 exporting attestation manifest sha256:908d92a3b18de5f7a71434bb7f6b38ca04af7c1bf156dc09b6799729c976bcca 0.1s done
#6 exporting manifest list sha256:7ab5d20df8cae95ac2594c4d7002f79d84a58e09e51707830ca2aea1e0d5e4ba

#6 exporting manifest list sha256:7ab5d20df8cae95ac2594c4d7002f79d84a58e09e51707830ca2aea1e0d5e4ba 0.0s done
#6 naming to docker.io/library/sailfish-sdk-build-engine:gbaudic 0.0s done
#6 unpacking to docker.io/library/sailfish-sdk-build-engine:gbaudic

#6 unpacking to docker.io/library/sailfish-sdk-build-engine:gbaudic 41.0s done

#6 DONE 193.2s

sailfish-sdk-tools_gbaudic

+ tar -C /srv/mer --numeric-owner -xpf /host_install/mersdk/sailfish-tools.tar.xz

tar: /host_install/mersdk/sailfish-tools.tar.xz: Cannot open: Permission denied
tar: Error is not recoverable: exiting now

As I use VirtualBox instead of Docker I’m not sure how the SDK sets all of this up, but could it be that /host_install/mersdk/ is a folder from the host system mounted into the countainer? Maybe this folder on the host has restrictive permissions so the container can’t access them?

This is pure speculation though

I used copilot asking what’s the issue and usually i get answer what is wrong try asking ai. You can even send screenshot asking guide

Thanks. I managed to solve my problem (eventually ended up having to ask AI). So for future reference to anyone trying to install the SDK on openSUSE Tumbleweed:

Problem: the installer does not find the metadata to download. Console shows an impossibility to create an SSL connection.
Solution: the openssl headers were provided by libressl instead of openssl. Replacing it by the openssl-devel package solves the issue.

Problem: Permission denied when trying to untar sailfish-tools.tar.xz (subject of this thread)
Solution: the installer log had the full command line. It turns out that /srv/mer is a persistent volume and /host_install is a temporary volume being mapped to the ~/SailfishOS directory. All permissions were OK, the error was in fact caused by SELinux preventing the access. I fixed it as follows:

  • When encountering the error, go to ~/SailfishOS/mersdk and copy the sailfish-tools.tar.xz somewhere else, because the installer will delete it afterwards
  • Click Ignore to let the install proceed
  • Put the archive back at its original location
  • Replay the failed command by hand (you can find it in the Installation tool log inside the ~/SailfishOS folder) but add :Z to the volume argument, i.e. /home/gbaudic/SailfishOS:/host_install:Z. The Docker documentation does state that the :Z option can be dangerous, though.

Maybe I should open an issue about SELinux not being supported? I did not find anything about it in the documentation.