PaNOSC-ViNYL / SimEx

Start-to-end photon experiment simulation platform
https://simex.readthedocs.io/
GNU General Public License v3.0
26 stars 25 forks source link

Add in the WP5-sprint-based SimEx Dockerfile #226

Closed cloudbustinguk closed 3 years ago

cloudbustinguk commented 3 years ago

As requested by Shervin - pushing the new Dockerfile to his branch to facilitate quicker testing.

shervin86 commented 3 years ago

Hi, I have cherry-picked your commit on top of my rebased branch.

Any reason for not adding #!/bin/sh at the beginning of build_image?

When I try to run, I get:
STEP 1: FROM chuckie82/centos_env
Getting image source signatures
Copying blob 5665c429fe1d done
Copying blob ed93095ee6eb done
Copying blob 59e69571f6c7 done
Copying blob 07983e1ef77a done
Copying blob f791d9031a99 done
Copying blob dedde21d7d19 done
Copying blob 17dc84771412 done
Copying blob 86d640db9ada done
Copying blob 4d0d9ad87c0b done
Copying config c5119e6051 done
Writing manifest to image destination
Storing signatures
error creating build container: The following failures happened while trying to pull image specified by "chuckie82/centos_env" based on search registries in /etc/containers/registries.conf:
* "localhost/chuckie82/centos_env": Error initializing source docker://localhost/chuckie82/centos_env:latest: error pinging docker registry localhost: Get https://localhost/v2/: dial tcp [::1]:443: connect: connection refused
* "registry.access.redhat.com/chuckie82/centos_env": Error initializing source docker://registry.access.redhat.com/chuckie82/centos_env:latest: Error reading manifest latest in registry.access.redhat.com/chuckie82/centos_env: name unknown: Repo not found
* "registry.redhat.io/chuckie82/centos_env": Error initializing source docker://registry.redhat.io/chuckie82/centos_env:latest: unable to retrieve auth token: invalid username/password: unauthorized: Please login to the Red Hat Registry using your Customer Portal credentials. Further instructions can be found here: https://access.redhat.com/RegistryAuthentication
* "docker.io/chuckie82/centos_env": Error committing the finished image: error adding layer with blob "sha256:dedde21d7d1961eef0515f45337e100e73e509a1525632f2923af0234b329380": Error processing tar file(exit status 1): write /etc/udev/hwdb.bin: no space left on device
ERRO exit status 1                                

Do you have any clue about what I might be doing wrong or that might be missing on my system? Does it require root privilege ?

cloudbustinguk commented 3 years ago

Hi Shervin, answers below:

Hi, I have cherry-picked your commit on top of my rebased branch.

Any reason for not adding #!/bin/sh at the beginning of build_image?

Bash is smart enough to know what to do with an executable file containing commands - but we can add the shebang if you want it there - no problem.

error creating build container: The following failures happened while trying to pull image specified by "chuckie82/centos_env" based on search registries in /etc/containers/registries.conf:

  • "localhost/chuckie82/centos_env": Error initializing source docker://localhost/chuckie82/centos_env:latest: error pinging docker registry localhost: Get https://localhost/v2/: dial tcp [::1]:443: connect: connection refused
  • "registry.access.redhat.com/chuckie82/centos_env": Error initializing source docker://registry.access.redhat.com/chuckie82/centos_env:latest: Error reading manifest latest in registry.access.redhat.com/chuckie82/centos_env: name unknown: Repo not found
  • "registry.redhat.io/chuckie82/centos_env": Error initializing source docker://registry.redhat.io/chuckie82/centos_env:latest: unable to retrieve auth token: invalid username/password: unauthorized: Please login to the Red Hat Registry using your Customer Portal credentials. Further instructions can be found here: https://access.redhat.com/RegistryAuthentication
  • "docker.io/chuckie82/centos_env": Error committing the finished image: error adding layer with blob "sha256:dedde21d7d1961eef0515f45337e100e73e509a1525632f2923af0234b329380": Error processing tar file(exit status 1): write /etc/udev/hwdb.bin: no space left on device ERRO exit status 1

Do you have any clue about what I might be doing wrong or that might be missing on my system? Does it require root privilege ?

The real error is:

: write /etc/udev/hwdb.bin: no space left on device

Your home dir (most probably) is full. Container builds take a lot of space.

podman by default tries to search the official redhat repos first, so you can ignore the initial errors.

If you want to free up space, you can do this (but beware - all local images will be purged)

podman rmi $(podman images -q)

It doesn't require root privs, no (the build phase)

Cheers

Dan

shervin86 commented 3 years ago

Thanks for the very quick reply. Is there a way to define a different build directory?

cloudbustinguk commented 3 years ago

Thanks for the very quick reply. Is there a way to define a different build directory?

Sure - take a look at /etc/containers/storage.conf. You might find that /var is full - at least, that's the default (/var/lib/containers/storage). I set mine to live in my $HOME

cloudbustinguk commented 3 years ago

BTW - I am working on a new image which incorporates a few things which were missing from the new code, and fixes a few issues.

cloudbustinguk commented 3 years ago

On the subject of podman config - those registry errors you saw - you can adjust the registry search order by editing /etc/containers/registries.conf. You could put docker.io first in that list, and it's "first match wins". Unless you are working with RHEL/UBI or OpenShift, you'll likely only ever need to touch docker.io anyway.

shervin86 commented 3 years ago

Ok, so we will wait for that then

JunCEEE commented 3 years ago

Is this still needed, or should I close this pull request?