Getting "nsenter: USER is unset: Inappropriate ioctl for device" error trying to run img on Ubuntu 16.04
Hi, I installed img 0.5.7 on top of Ubuntu with the required packages as root. uname -a returns:
Linux 82b577ed1adb 4.4.0-154-generic #181-Ubuntu SMP Tue Jun 25 05:29:03 UTC 2019 x86_64 x86_64 x86_64 GNU/Linux
here is my script:
#!/bin/bash
export IMG_DISABLE_EMBEDDED_RUNC=1
apt-get update
apt-get install uidmap libseccomp-dev
chmod 4755 /usr/bin/newuidmap
echo "root:100000:65536" > /etc/subgid
echo "root:100000:65536" > /etc/subuid
echo "Downloading img"
curl -fSL -o /usr/local/bin/img https://github.com/genuinetools/img/releases/download/v0.5.7/img-linux-amd64
curl -fSL https://github.com/genuinetools/img/releases/download/v0.5.7/img-linux-amd64.sha256 -o /usr/local/bin/img-linux-amd64.sha256
echo "Checking download hash"
echo "`cat /usr/local/bin/img-linux-amd64.sha256 | awk '{print $1}'` /usr/local/bin/img" | sha256sum -c -
echo "Installing img"
chmod a+x /usr/local/bin/img
img build -t test:latest -f Dockerfile .
Unfortunately I always get this error nsenter: USER is unset: Inappropriate ioctl for device. I tried to search for a solution, but I didn't find anything useful. Any idea what could be wrong?
Thanks for any pointers you might have.
Issue Label Bot is not confident enough to auto-label this issue. See dashboard for more details.
note that if I do: img version, it works.
Were you ever able to solve this? I'm running into the same issue, with the same error, only difference is I've stepped up to 0.5.11
sh '''
sudo apt-get update -y \\
&& sudo apt-get install -y uidmap \\
&& echo "Downloading img" \\
&& curl -fSL "https://github.com/genuinetools/img/releases/download/v0.5.11/img-linux-amd64" -o "/usr/local/bin/img" \\
&& echo "cc9bf08794353ef57b400d32cd1065765253166b0a09fba360d927cfbd158088 /usr/local/bin/img" | sha256sum -c - \\
&& chmod a+x "/usr/local/bin/img"
'''
sh 'img -v'
echo "img installed!"
I can install the img, but on building image throwing same error, any update on this?
got the fix
sudo apt-get update -y \\
&& sudo apt-get install -y uidmap \\
&& sudo apt-get install -y qemu-user-static \\
&& echo "Downloading img" \\
&& curl -fSL "https://github.com/genuinetools/img/releases/download/v0.5.11/img-linux-amd64" -o "/usr/local/bin/img" \\
&& echo "cc9bf08794353ef57b400d32cd1065765253166b0a09fba360d927cfbd158088 /usr/local/bin/img" | sha256sum -c - \\
&& chmod a+x "/usr/local/bin/img"
Also configured the environment for Jenkins pipeline.
environment {
USER = "jenkins"
}