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

Unable to find a match: localedef #653

Open
iishiishii opened this issue Jan 14, 2025 · 2 comments
Open

Unable to find a match: localedef #653

iishiishii opened this issue Jan 14, 2025 · 2 comments

Comments

@iishiishii
Copy link

My neurodocker recipe fails at this error after pulling the base image.

 => ERROR [ 2/17] RUN export ND_ENTRYPOINT="/neurodocker/startup.sh"     && yum install -y -q            bzip2            ca-certificates            curl            epel-release           8.5s
------
 > [ 2/17] RUN export ND_ENTRYPOINT="/neurodocker/startup.sh"     && yum install -y -q            bzip2            ca-certificates            curl            epel-release            localedef            unzip     && yum clean all     && rm -rf /var/cache/yum/*     && localedef -i en_US -f UTF-8 en_US.UTF-8     && chmod 777 /opt && chmod a+s /opt     && mkdir -p /neurodocker     && if [ ! -f "/neurodocker/startup.sh" ]; then          echo '#!/usr/bin/env bash' >> "/neurodocker/startup.sh"     &&   echo 'set -e' >> "/neurodocker/startup.sh"     &&   echo 'export USER="${USER:=`whoami`}"' >> "/neurodocker/startup.sh"     &&   echo 'if [ -n "$1" ]; then "$@"; else /usr/bin/env bash; fi' >> "/neurodocker/startup.sh";     fi     && chmod -R 777 /neurodocker && chmod a+s /neurodocker:
6.787 Error: Unable to find a match: localedef
------
deepretinotopy_1.0.6.Dockerfile:7
--------------------
   6 |         ND_ENTRYPOINT="/neurodocker/startup.sh"
   7 | >>> RUN export ND_ENTRYPOINT="/neurodocker/startup.sh" \
   8 | >>>     && yum install -y -q \
   9 | >>>            bzip2 \
  10 | >>>            ca-certificates \
  11 | >>>            curl \
  12 | >>>            epel-release \
  13 | >>>            localedef \
  14 | >>>            unzip \
  15 | >>>     && yum clean all \
  16 | >>>     && rm -rf /var/cache/yum/* \
  17 | >>>     && localedef -i en_US -f UTF-8 en_US.UTF-8 \
  18 | >>>     && chmod 777 /opt && chmod a+s /opt \
  19 | >>>     && mkdir -p /neurodocker \
  20 | >>>     && if [ ! -f "$ND_ENTRYPOINT" ]; then \
  21 | >>>          echo '#!/usr/bin/env bash' >> "$ND_ENTRYPOINT" \
  22 | >>>     &&   echo 'set -e' >> "$ND_ENTRYPOINT" \
  23 | >>>     &&   echo 'export USER="${USER:=`whoami`}"' >> "$ND_ENTRYPOINT" \
  24 | >>>     &&   echo 'if [ -n "$1" ]; then "$@"; else /usr/bin/env bash; fi' >> "$ND_ENTRYPOINT"; \
  25 | >>>     fi \
  26 | >>>     && chmod -R 777 /neurodocker && chmod a+s /neurodocker
  27 |     RUN yum install -y -q \
--------------------
ERROR: failed to solve: process "/bin/sh -c export ND_ENTRYPOINT=\"/neurodocker/startup.sh\"     && yum install -y -q            bzip2            ca-certificates            curl            epel-release            localedef            unzip     && yum clean all     && rm -rf /var/cache/yum/*     && localedef -i en_US -f UTF-8 en_US.UTF-8     && chmod 777 /opt && chmod a+s /opt     && mkdir -p /neurodocker     && if [ ! -f \"$ND_ENTRYPOINT\" ]; then          echo '#!/usr/bin/env bash' >> \"$ND_ENTRYPOINT\"     &&   echo 'set -e' >> \"$ND_ENTRYPOINT\"     &&   echo 'export USER=\"${USER:=`whoami`}\"' >> \"$ND_ENTRYPOINT\"     &&   echo 'if [ -n \"$1\" ]; then \"$@\"; else /usr/bin/env bash; fi' >> \"$ND_ENTRYPOINT\";     fi     && chmod -R 777 /neurodocker && chmod a+s /neurodocker" did not complete successfully: exit code: 1

Here is part of my recipe:

neurodocker generate ${neurodocker_buildMode} \
   --base-image ghcr.io/neurodesk/freesurfer_7.3.2:20230216 \
   --pkg-manager yum \
   --install git \

I tried to use apt instead of yum but still got the same error.
Appreciate any suggestions to fix it.

@iishiishii
Copy link
Author

Even in the base centos:7 image when generating Dockerfile with neurodocker

neurodocker generate docker --base-image centos:7 --pkg-manager yum --install git > centos.Dockerfile
docker build -t centos:15012025 -f centos.Dockerfile .

it failed to retrieve the mirror list with the following error:

------                                                                                                           
 > [2/4] RUN export ND_ENTRYPOINT="/neurodocker/startup.sh"     && yum install -y -q            bzip2            ca-certificates            curl            epel-release            localedef            unzip     && yum clean all     && rm -rf /var/cache/yum/*     && localedef -i en_US -f UTF-8 en_US.UTF-8     && chmod 777 /opt && chmod a+s /opt     && mkdir -p /neurodocker     && if [ ! -f "/neurodocker/startup.sh" ]; then          echo '#!/usr/bin/env bash' >> "/neurodocker/startup.sh"     &&   echo 'set -e' >> "/neurodocker/startup.sh"     &&   echo 'export USER="${USER:=`whoami`}"' >> "/neurodocker/startup.sh"     &&   echo 'if [ -n "$1" ]; then "$@"; else /usr/bin/env bash; fi' >> "/neurodocker/startup.sh";     fi     && chmod -R 777 /neurodocker && chmod a+s /neurodocker:
0.880 Could not retrieve mirrorlist http://mirrorlist.centos.org/?release=7&arch=x86_64&repo=os&infra=container error was
0.880 14: curl#6 - "Could not resolve host: mirrorlist.centos.org; Name or service not known"
0.884 
0.884 
0.884  One of the configured repositories failed (Unknown),
0.884  and yum doesn't have enough cached data to continue. At this point the only
0.884  safe thing yum can do is fail. There are a few ways to work "fix" this:
0.884 
0.884      1. Contact the upstream for the repository and get them to fix the problem.
0.884 
0.884      2. Reconfigure the baseurl/etc. for the repository, to point to a working
0.884         upstream. This is most often useful if you are using a newer
0.884         distribution release than is supported by the repository (and the
0.884         packages for the previous distribution release still work).
0.884 
0.884      3. Run the command with the repository temporarily disabled
0.884             yum --disablerepo=<repoid> ...
0.884 
0.884      4. Disable the repository permanently, so yum won't use it by default. Yum
0.884         will then just ignore the repository until you permanently enable it
0.884         again or use --enablerepo for temporary usage:
0.884 
0.884             yum-config-manager --disable <repoid>
0.884         or
0.884             subscription-manager repos --disable=<repoid>
0.884 
0.884      5. Configure the failing repository to be skipped, if it is unavailable.
0.884         Note that yum will try to contact the repo. when it runs most commands,
0.884         so will have to try and fail each time (and thus. yum will be be much
0.884         slower). If it is a very temporary problem though, this is often a nice
0.884         compromise:
0.884 
0.884             yum-config-manager --save --setopt=<repoid>.skip_if_unavailable=true
0.884 
0.884 Cannot find a valid baseurl for repo: base/7/x86_64
------
test.Dockerfile:7
--------------------
   6 |         ND_ENTRYPOINT="/neurodocker/startup.sh"
   7 | >>> RUN export ND_ENTRYPOINT="/neurodocker/startup.sh" \
   8 | >>>     && yum install -y -q \
   9 | >>>            bzip2 \
  10 | >>>            ca-certificates \
  11 | >>>            curl \
  12 | >>>            epel-release \
  13 | >>>            localedef \
  14 | >>>            unzip \
  15 | >>>     && yum clean all \
  16 | >>>     && rm -rf /var/cache/yum/* \
  17 | >>>     && localedef -i en_US -f UTF-8 en_US.UTF-8 \
  18 | >>>     && chmod 777 /opt && chmod a+s /opt \
  19 | >>>     && mkdir -p /neurodocker \
  20 | >>>     && if [ ! -f "$ND_ENTRYPOINT" ]; then \
  21 | >>>          echo '#!/usr/bin/env bash' >> "$ND_ENTRYPOINT" \
  22 | >>>     &&   echo 'set -e' >> "$ND_ENTRYPOINT" \
  23 | >>>     &&   echo 'export USER="${USER:=`whoami`}"' >> "$ND_ENTRYPOINT" \
  24 | >>>     &&   echo 'if [ -n "$1" ]; then "$@"; else /usr/bin/env bash; fi' >> "$ND_ENTRYPOINT"; \
  25 | >>>     fi \
  26 | >>>     && chmod -R 777 /neurodocker && chmod a+s /neurodocker
  27 |     RUN yum install -y -q \
--------------------

@iishiishii
Copy link
Author

The official centos docker image already has curl and localedef installed. So it may not need to reinstall that in _default.yml

iishiishii added a commit to iishiishii/neurodocker that referenced this issue Jan 15, 2025
…es. Removed curl and localedef in dependencies. Fix ReproNim#653
satra pushed a commit that referenced this issue Jan 15, 2025
…es. Removed curl and localedef in dependencies. Fix #653
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

1 participant