Search code examples
apkartifactory

artifactory alpine remote repo - permission denied problem


I have created an alpine remote repo on my artifactory instance but cannot install apk packages from it in my apk client

when I apk update in my alpine docker I get permission denied:

e.g.

docker run -it alpine /bin/sh

echo "https://first.last%40mycompany.com:AKmyartifactorytoken@myserver.mycompany.com/artifactory/alpine_linux_org-remote/v3.10/main" > /etc/apk/repositories

apk update


fetch https://first.last%40mycompany.com:AK..token@myserver.mycompany.com/artifactory/alpine_linux_org-remote/v3.10/main/x86_64/APKINDEX.tar.gz
ERROR: https://first.last%40mycompany.com:AK..token@myserver.mycompany.com/artifactory/alpine_linux_org-remote/v3.10/main: **Permission denied**
WARNING: Ignoring APKINDEX.fe5b96c4.tar.gz: No such file or directory
1 errors; 14 distinct packages available

I believe the problem is to do with username/password because I get the same error when I use no username/password. You'll notice I am URL encoding my username, replacing the @ symbol with %40

I have tried with and without URL encoding

The following does work and downloads the APKINDEX.tar.gz successfully:

wget https://first.last%40mycompany.com:AKmytoken@myserver.mycompany.com/artifactory/alpine_linux_org-remote/v3.10/main/x86_64/APKINDEX.tar.gz

Solution

  • As this is a problem with permission denied and I see you are using '@' in the username and confirmed it is working with wget command, it is the problem with the APK client as it does not understand the '@' sign and fails with permission denied. Try with an user who does not have '@' sign in it.