In the container which is running on sysbox, the cmd “dotnet build” failed
I have some trobules about dotnet sdk build issue in the docker container base on sysbox, here is my situation
- I build an images named sysbox here is dockerfile FROM ubuntu:bionic
Systemd installation
RUN apt-get update &&
apt-get install -y --no-install-recommends
systemd
systemd-sysv
libsystemd0
ca-certificates
dbus
iptables
iproute2
kmod
locales
sudo
git
wget
udev &&
# Prevents journald from reading kernel messages from /dev/kmsg
echo "ReadKMsg=no" >> /etc/systemd/journald.conf &&
# Housekeeping
apt-get clean -y &&
rm -rf
/var/cache/debconf/*
/var/lib/apt/lists/*
/var/log/*
/tmp/*
/var/tmp/*
/usr/share/doc/*
/usr/share/man/*
/usr/share/local/* &&
# Create default 'admin/admin' user
useradd --create-home --shell /bin/bash admin && echo "admin:admin" | chpasswd && adduser admin sudo
Sshd install
RUN apt-get update && apt-get install --no-install-recommends -y
openssh-server &&
mkdir /home/admin/.ssh &&
chown admin:admin /home/admin/.ssh
Docker install
RUN apt-get update && apt-get install --no-install-recommends -y
apt-transport-https
ca-certificates
curl
gnupg-agent
software-properties-common &&
curl -fsSL https://download.docker.com/linux/ubuntu/gpg
| apt-key add - &&
apt-key fingerprint 0EBFCD88 &&
add-apt-repository
"deb [arch=amd64] https://download.docker.com/linux/ubuntu
$(lsb_release -cs)
stable" &&
apt-get update && apt-get install --no-install-recommends -y
docker-ce=5:19.03.12~3-0~ubuntu-bionic
docker-ce-cli=5:19.03.12~3-0~ubuntu-bionic
containerd.io=1.2.13-2 &&
# Housekeeping
apt-get clean -y &&
rm -rf
/var/cache/debconf/*
/var/lib/apt/lists/*
/var/log/*
/tmp/*
/var/tmp/*
/usr/share/doc/*
/usr/share/man/*
/usr/share/local/* &&
# Add user "admin" to the Docker group
usermod -a -G docker admin
#Powershell install RUN apt-get update RUN apt-get install -y wget apt-transport-https software-properties-common RUN wget -q https://packages.microsoft.com/config/ubuntu/20.04/packages-microsoft-prod.deb RUN dpkg -i packages-microsoft-prod.deb RUN apt-get update RUN apt-get install -y powershell RUN rm -rf packages-microsoft-prod.deb
#Dapr install RUN wget -q https://raw.githubusercontent.com/dapr/cli/master/install/install.sh -O - | /bin/bash RUN dapr
RUN dapr init
EXPOSE 22 8080 443 6000 6001 6002 3600 3601 3602 4000 5000
Set systemd as entrypoint.
ENTRYPOINT [ "/sbin/init", "--log-level=err" ]
- I build an image extend sysbox here is dockerfile and named testdotnet FROM sysbox
#Dotnet 6 install
RUN wget https://packages.microsoft.com/config/ubuntu/21.04/packages-microsoft-prod.deb -O packages-microsoft-prod.deb
RUN dpkg -i packages-microsoft-prod.deb
RUN rm -rf packages-microsoft-prod.deb
RUN sudo apt-get update && \
sudo apt-get install -y apt-transport-https &&
sudo apt-get update &&
sudo apt-get install -y dotnet-sdk-6.0
ENV HOME=/home/admin ENV DOTNET_ROOT=$HOME/dotnet ENV PATH=$HOME/dotnet:$PATH ENV PATH=$HOME/.dotnet/tools:$PATH ENV DOTNET_CLI_TELEMETRY_OPTOUT=false
- after I excutetd “sudo docker run --runtime=sysbox-runc -it --rm -P --hostname=syscont test” and ssh in the container testdotnet
- I excuted dotnet new console -o myapp and cd myapp
- when I excuted dotnet build in myapp,it show these message
,but if I run the cmd like this “sudo docker run -d -p 8080:80 testdotnet" it wouldn't appear this error
@XiaotongZhao, thanks for reporting this issue.
To simplify its reproduction on our end, could you please share the content of both of the Dockerfiles that you utilized? I can see that you try to do that above but the formatting is somewhat broken and difficult to follow.
Certainly! here is my dockerfiles I have ziped these files to the package, hope you can figure out the reason, by the way I uninstalled the sysbox c.e and installed the Sysbox e.e several hours ago, it didn't show the error and it could work !! MyDockfiles.zip