Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make test-img not working on ubuntu-focal without some Dockerfile changes #899

Open
tan-wei-xin-alez opened this issue Jan 15, 2025 · 1 comment

Comments

@tan-wei-xin-alez
Copy link

This issue is similar to sysbox-in-docker does not work on ubuntu-focal without some Dockerfile changes which I opened previously

Describe the issue as clearly and completely as possible.

I finally got around to following the advice here and looking through the developers-guide on how to use the Makefile

Running the following commands

git clone --recurse-submodules https://github.com/nestybox/sysbox.git nestybox/sysbox
make -C nestybox/sysbox test-img

gives me the following error

➜  ~ make -C nestybox/sysbox test-img
make: Entering directory '/home/alez/nestybox/sysbox'
bash: go: command not found
bash: go: command not found
bash: go: command not found
bash: go: command not found
bash: go: command not found
bash: go: command not found
bash: go: command not found
bash: go: command not found
bash: go: command not found
bash: go: command not found
bash: go: command not found
bash: go: command not found
bash: go: command not found
bash: go: command not found

** Building the test container **

[+] Building 4.0s (17/30)                                                                                  docker:default
 => [internal] load build definition from Dockerfile.ubuntu-focal                                                    0.0s
 => => transferring dockerfile: 8.54kB                                                                               0.0s
 => [internal] load metadata for docker.io/library/ubuntu:focal                                                      1.9s
 => [internal] load .dockerignore                                                                                    0.0s
 => => transferring context: 2B                                                                                      0.0s
 => [internal] load build context                                                                                    0.0s
 => => transferring context: 223B                                                                                    0.0s
 => [ 9/25] ADD https://raw.githubusercontent.com/docker/docker-ce/master/components/cli/contrib/completion/bash/do  1.0s
 => [ 1/25] FROM docker.io/library/ubuntu:focal@sha256:8e5c4f0285ecbb4ead070431d29b576a530d3166df73ec44affc1cd27555  0.0s
 => CACHED [ 2/25] RUN apt-get update && apt-get install -y     acl     build-essential     gcc-x86-64-linux-gnu     0.0s
 => CACHED [ 3/25] RUN wget https://go.dev/dl/go1.22.6.linux-amd64.tar.gz &&     tar -C /usr/local -xzf go1.22.6.li  0.0s
 => CACHED [ 4/25] RUN go env -w GONOSUMDB=/root/nestybox &&     mkdir -p "/go/src" "/go/bin" &&     chmod -R 777 "  0.0s
 => CACHED [ 5/25] RUN useradd -u1000 -m -d/home/rootless -s/bin/bash rootless                                       0.0s
 => CACHED [ 6/25] RUN cd /tmp     && git clone https://github.com/sstephenson/bats.git     && cd bats     && git r  0.0s
 => CACHED [ 7/25] RUN if [ "amd64" = "amd64" ] ; then arch_str="x86_64";     elif [ "amd64" = "arm64" ]; then arch  0.0s
 => CACHED [ 8/25] RUN curl -fsSL https://get.docker.com -o get-docker.sh     && sh get-docker.sh                    0.0s
 => CACHED [ 9/25] ADD https://raw.githubusercontent.com/docker/docker-ce/master/components/cli/contrib/completion/  0.0s
 => CACHED [10/25] RUN go install github.com/go-delve/delve/cmd/dlv@latest                                           0.0s
 => CACHED [11/25] RUN cd /tmp && curl -LO "https://dl.k8s.io/release/v1.28.2/bin/linux/amd64/kubectl"     && insta  0.0s
 => ERROR [12/25] RUN echo "deb [signed-by=/usr/share/keyrings/libcontainers-archive-keyring.gpg] https://download.  1.0s
------
 > [12/25] RUN echo "deb [signed-by=/usr/share/keyrings/libcontainers-archive-keyring.gpg] https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_22.04/ /" > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list     && echo "deb [signed-by=/usr/share/keyrings/libcontainers-crio-archive-keyring.gpg] https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable:/cri-o:/1.28/xUbuntu_22.04/ /" > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable:cri-o:$VERSION.list     && mkdir -p /usr/share/keyrings     && curl -L https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_22.04/Release.key | gpg --dearmor -o /usr/share/keyrings/libcontainers-archive-keyring.gpg     && curl -L https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable:/cri-o:/1.28/xUbuntu_22.04/Release.key | gpg --dearmor -o /usr/share/keyrings/libcontainers-crio-archive-keyring.gpg     && apt-get update     && apt-get install -y cri-o cri-o-runc:
0.294 /bin/sh: 1: gpg: not found
0.306   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
0.306                                  Dload  Upload   Total   Spent    Left  Speed
100  1093  100  1093    0     0   1641      0 --:--:-- --:--:-- --:--:--  1641
0.972 (23) Failed writing body
------

 1 warning found (use docker --debug to expand):
 - JSONArgsRecommended: JSON arguments recommended for CMD to prevent unintended behavior related to OS signals (line 223)
Dockerfile.ubuntu-focal:160
--------------------
 159 |     # works with Sysbox.
 160 | >>> RUN echo "deb [signed-by=/usr/share/keyrings/libcontainers-archive-keyring.gpg] https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/${crio_os}/ /" > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list \
 161 | >>>     && echo "deb [signed-by=/usr/share/keyrings/libcontainers-crio-archive-keyring.gpg] https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable:/cri-o:/${crio_version}/${crio_os}/ /" > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable:cri-o:$VERSION.list \
 162 | >>>     && mkdir -p /usr/share/keyrings \
 163 | >>>     && curl -L https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/${crio_os}/Release.key | gpg --dearmor -o /usr/share/keyrings/libcontainers-archive-keyring.gpg \
 164 | >>>     && curl -L https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable:/cri-o:/${crio_version}/${crio_os}/Release.key | gpg --dearmor -o /usr/share/keyrings/libcontainers-crio-archive-keyring.gpg \
 165 | >>>     && apt-get update \
 166 | >>>     && apt-get install -y cri-o cri-o-runc
 167 |
--------------------
ERROR: failed to solve: process "/bin/sh -c echo \"deb [signed-by=/usr/share/keyrings/libcontainers-archive-keyring.gpg] https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/${crio_os}/ /\" > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list     && echo \"deb [signed-by=/usr/share/keyrings/libcontainers-crio-archive-keyring.gpg] https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable:/cri-o:/${crio_version}/${crio_os}/ /\" > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable:cri-o:$VERSION.list     && mkdir -p /usr/share/keyrings     && curl -L https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/${crio_os}/Release.key | gpg --dearmor -o /usr/share/keyrings/libcontainers-archive-keyring.gpg     && curl -L https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable:/cri-o:/${crio_version}/${crio_os}/Release.key | gpg --dearmor -o /usr/share/keyrings/libcontainers-crio-archive-keyring.gpg     && apt-get update     && apt-get install -y cri-o cri-o-runc" did not complete successfully: exit code: 127
make: *** [Makefile:467: test-img] Error 1
make: Leaving directory 'nestybox/sysbox'

Include information about the host's Linux version (e.g., lsb_release, uname -a).

➜  ~ fastfetch
                             ....              
              .',:clooo:  .:looooo:.           ------------------------
           .;looooooooc  .oooooooooo'          OS: Ubuntu focal 20.04 x86_64
        .;looooool:,''.  :ooooooooooc          Host: Precision 5570
       ;looool;.         'oooooooooo,          Kernel: Linux 5.15.0-127-generic
      ;clool'             .cooooooc.  ,,       Uptime: 6 days, 25 mins
         ...                ......  .:oo,      Packages: 2337 (dpkg), 16 (snap), 210 (brew)
  .;clol:,.                        .loooo'     Shell: zsh 5.9
 :ooooooooo,                        'ooool     Display (DELL E2211H): 1920x1080 @ 60 Hz in 22″ [External] *
'ooooooooooo.                        loooo.    Display (SHP1515): 1920x1200 @ 60 Hz in 16″ [Built-in]
'ooooooooool                         coooo.    Display (ARZOPA): 1920x1080 @ 60 Hz in 16″ [External]
 ,loooooooc.                        .loooo.    Display (SAMSUNG): 1360x768 @ 60 Hz in 7″ [External]
   .,;;;'.                          ;ooooc     DE: GNOME 3.36.9
       ...                         ,ooool.     WM: Mutter (X11)
    .cooooc.              ..',,'.  .cooo.      WM Theme: Adwaita
      ;ooooo:.           ;oooooooc.  :l.       Theme: Adwaita [GTK2/3/4]
       .coooooc,..      coooooooooo.           Icons: Adwaita [GTK2/3/4]
         .:ooooooolc:. .ooooooooooo'           Font: Cantarell (11pt) [GTK2/3/4]
           .':loooooo;  ,oooooooooc            Cursor: Adwaita (24px)
               ..';::c'  .;loooo:'             Terminal: tmux 3.4
                                               CPU: 12th Gen Intel(R) Core(TM) i9-12900H (20) @ 5.00 GHz
                                               GPU 1: NVIDIA Device 25BA (3D)
                                               GPU 2: Intel Device 46A6 (VGA compatible) @ 1.45 GHz [Integrated]
                                               Memory: 12.96 GiB / 62.47 GiB (21%)
                                               Swap: 0 B / 2.00 GiB (0%)
                                               Disk (/): 521.30 GiB / 929.04 GiB (56%) - ext4
                                               Local IP (wlp0s20f3): 192.168.0.181/24
                                               Battery (DELL M59JH32): 100% [AC Connected]
                                               Locale: en_US.UTF-8

Workaround

Similar to sysbox-in-docker does not work on ubuntu-focal without some Dockerfile changes, I managed to get past the above error by adding gpg to tests/Dockerfile.ubuntu-focal but then I got the following error

➜  ~ make -C nestybox/sysbox test-img
make: Entering directory '/home/alez/nestybox/sysbox'
bash: go: command not found
bash: go: command not found
bash: go: command not found
bash: go: command not found
bash: go: command not found
bash: go: command not found
bash: go: command not found
bash: go: command not found
bash: go: command not found
bash: go: command not found
bash: go: command not found
bash: go: command not found
bash: go: command not found
bash: go: command not found

** Building the test container **

[+] Building 218.8s (17/30)                                                                                docker:default
 => [internal] load build definition from Dockerfile.ubuntu-focal                                                    0.0s
 => => transferring dockerfile: 8.55kB                                                                               0.0s
 => [internal] load metadata for docker.io/library/ubuntu:focal                                                      2.0s
 => [internal] load .dockerignore                                                                                    0.0s
 => => transferring context: 2B                                                                                      0.0s
 => [internal] load build context                                                                                    0.0s
 => => transferring context: 223B                                                                                    0.0s
 => CACHED [ 9/25] ADD https://raw.githubusercontent.com/docker/docker-ce/master/components/cli/contrib/completion/  1.2s
 => CACHED [ 1/25] FROM docker.io/library/ubuntu:focal@sha256:8e5c4f0285ecbb4ead070431d29b576a530d3166df73ec44affc1  0.0s
 => [ 2/25] RUN apt-get update && apt-get install -y     acl     build-essential     gcc-x86-64-linux-gnu     lib  132.2s
 => [ 3/25] RUN wget https://go.dev/dl/go1.22.6.linux-amd64.tar.gz &&     tar -C /usr/local -xzf go1.22.6.linux-amd  7.5s
 => [ 4/25] RUN go env -w GONOSUMDB=/root/nestybox &&     mkdir -p "/go/src" "/go/bin" &&     chmod -R 777 "/go"     0.3s
 => [ 5/25] RUN useradd -u1000 -m -d/home/rootless -s/bin/bash rootless                                              0.4s
 => [ 6/25] RUN cd /tmp     && git clone https://github.com/sstephenson/bats.git     && cd bats     && git reset --  1.3s
 => [ 7/25] RUN if [ "amd64" = "amd64" ] ; then arch_str="x86_64";     elif [ "amd64" = "arm64" ]; then arch_str="  11.3s
 => [ 8/25] RUN curl -fsSL https://get.docker.com -o get-docker.sh     && sh get-docker.sh                          42.0s
 => [ 9/25] ADD https://raw.githubusercontent.com/docker/docker-ce/master/components/cli/contrib/completion/bash/do  0.0s
 => [10/25] RUN go install github.com/go-delve/delve/cmd/dlv@latest                                                 11.9s
 => [11/25] RUN cd /tmp && curl -LO "https://dl.k8s.io/release/v1.28.2/bin/linux/amd64/kubectl"     && install -o r  3.2s
 => ERROR [12/25] RUN echo "deb [signed-by=/usr/share/keyrings/libcontainers-archive-keyring.gpg] https://download.  6.4s
------
 > [12/25] RUN echo "deb [signed-by=/usr/share/keyrings/libcontainers-archive-keyring.gpg] https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_22.04/ /" > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list     && echo "deb [signed-by=/usr/share/keyrings/libcontainers-crio-archive-keyring.gpg] https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable:/cri-o:/1.28/xUbuntu_22.04/ /" > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable:cri-o:$VERSION.list     && mkdir -p /usr/share/keyrings     && curl -L https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_22.04/Release.key | gpg --dearmor -o /usr/share/keyrings/libcontainers-archive-keyring.gpg     && curl -L https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable:/cri-o:/1.28/xUbuntu_22.04/Release.key | gpg --dearmor -o /usr/share/keyrings/libcontainers-crio-archive-keyring.gpg     && apt-get update     && apt-get install -y cri-o cri-o-runc:
0.430   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
0.430                                  Dload  Upload   Total   Spent    Left  Speed
100  1093  100  1093    0     0   1273      0 --:--:-- --:--:-- --:--:--  1272
1.303   % Total    % Received % Xferd  Average Speed   Time    Time     Time  Current
1.303                                  Dload  Upload   Total   Spent    Left  Speed
100  1093  100  1093    0     0   1783      0 --:--:-- --:--:-- --:--:--  1780
2.093 Hit:1 https://download.docker.com/linux/ubuntu focal InRelease
2.484 Hit:2 http://archive.ubuntu.com/ubuntu focal InRelease
2.701 Hit:3 http://archive.ubuntu.com/ubuntu focal-updates InRelease
2.701 Hit:4 http://security.ubuntu.com/ubuntu focal-security InRelease
2.804 Get:5 https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_22.04  InRelease [1639 B]
2.938 Hit:6 http://archive.ubuntu.com/ubuntu focal-backports InRelease
2.975 Get:7 https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable:/cri-o:/1.28/xUbuntu_22.04  InRelease [1632 B]
3.228 Get:8 https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/xUbuntu_22.04  Packages [8845 B]
3.466 Get:9 https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable:/cri-o:/1.28/xUbuntu_22.04  Packages [1802 B]
3.487 Fetched 13.9 kB in 1s (9351 B/s)
3.487 Reading package lists...
4.774 Reading package lists...
5.975 Building dependency tree...
6.181 Reading state information...
6.249 Some packages could not be installed. This may mean that you have
6.249 requested an impossible situation or if you are using the unstable
6.249 distribution that some required packages have not yet been created
6.249 or been moved out of Incoming.
6.249 The following information may help to resolve the situation:
6.249
6.249 The following packages have unmet dependencies:
6.345  cri-o-runc : Depends: libc6 (>= 2.34) but 2.31-0ubuntu9.16 is to be installed
6.359 E: Unable to correct problems, you have held broken packages.
------

 1 warning found (use docker --debug to expand):
 - JSONArgsRecommended: JSON arguments recommended for CMD to prevent unintended behavior related to OS signals (line 224)
Dockerfile.ubuntu-focal:161
--------------------
 160 |     # works with Sysbox.
 161 | >>> RUN echo "deb [signed-by=/usr/share/keyrings/libcontainers-archive-keyring.gpg] https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/${crio_os}/ /" > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list \
 162 | >>>     && echo "deb [signed-by=/usr/share/keyrings/libcontainers-crio-archive-keyring.gpg] https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable:/cri-o:/${crio_version}/${crio_os}/ /" > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable:cri-o:$VERSION.list \
 163 | >>>     && mkdir -p /usr/share/keyrings \
 164 | >>>     && curl -L https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/${crio_os}/Release.key | gpg --dearmor -o /usr/share/keyrings/libcontainers-archive-keyring.gpg \
 165 | >>>     && curl -L https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable:/cri-o:/${crio_version}/${crio_os}/Release.key | gpg --dearmor -o /usr/share/keyrings/libcontainers-crio-archive-keyring.gpg \
 166 | >>>     && apt-get update \
 167 | >>>     && apt-get install -y cri-o cri-o-runc
 168 |
--------------------
ERROR: failed to solve: process "/bin/sh -c echo \"deb [signed-by=/usr/share/keyrings/libcontainers-archive-keyring.gpg] https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/${crio_os}/ /\" > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable.list     && echo \"deb [signed-by=/usr/share/keyrings/libcontainers-crio-archive-keyring.gpg] https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable:/cri-o:/${crio_version}/${crio_os}/ /\" > /etc/apt/sources.list.d/devel:kubic:libcontainers:stable:cri-o:$VERSION.list     && mkdir -p /usr/share/keyrings     && curl -L https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable/${crio_os}/Release.key | gpg --dearmor -o /usr/share/keyrings/libcontainers-archive-keyring.gpg     && curl -L https://download.opensuse.org/repositories/devel:/kubic:/libcontainers:/stable:/cri-o:/${crio_version}/${crio_os}/Release.key | gpg --dearmor -o /usr/share/keyrings/libcontainers-crio-archive-keyring.gpg     && apt-get update     && apt-get install -y cri-o cri-o-runc" did not complete successfully: exit code: 100
make: *** [Makefile:467: test-img] Error 1
make: Leaving directory 'nestybox/sysbox'

which I then got past by changing ARG crio_os=xUbuntu_22.04 to ARG crio_os=xUbuntu_20.04

Where do the errors related to go come from? Do they matter if I only need to build the sysbox-test-amd64 image?

@ctalledo
Copy link
Member

Hi @tan-wei-xin-alez,

Thanks for trying and glad you made some progress.

I managed to get past the above error by adding gpg

Makes sense, looks like the tests/Dockerfile.ubuntu-focal is missing that.

Where do the errors related to go come from? Do they matter if I only need to build the sysbox-test-amd64 image?

Not quite sure where the bash: go: command not found errors are coming from, but they are not critical and should not matter (you can ignore them). I think it's looking for go to be installed on the host somehow, but that means there's a mistake somewhere because all golang dependencies should be solely within the container we use to build & test Sysbox.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants