Score:0

Docker : Failed to download metadata for repo 'appstream'

cu flag

I am using Docker. I am newbie in this tech, so please let me know if require any other info

Want to install a remote host,

docker-compose.yml

version: '3.8'
services:
  jenkins:
    container_name: jenkins
    image: jenkins/jenkins
    ports:
      - "8080:8080"
    volumes:
      - "$PWD/jenkins_home:/var/jenkins_home"
    networks:
      - net
  remote_host:
    container_name: remote-host
    image: remote-host
    build:
      context: centos
    networks:
      - net
networks:
  net:

Docker File :

FROM centos


RUN dnf install openssh-server


RUN useradd remote_user && \
    echo "remote_user:1234" | chpasswd && \
    mkdir /home/remote_user/.ssh && \
    chmod 700 /home/remote_user/.ssh

COPY remote-key.pub /home/remote_user/.ssh/authorized_keys

RUN chown remote_user:remote_user -R /home/remote_user/.ssh/ && \
    chmod 600 /home/remote_user/.ssh/authorized_keys

RUN ssh-keygen -A

CMD /usr/sbin/sshd -D

Exception I am facing

[jenkins@localhost jenkins-data]$ docker compose build
[+] Building 4.1s (6/10)
 => [internal] load build definition from Dockerfile                                                                                                               0.1s
 => => transferring dockerfile: 516B                                                                                                                               0.0s
 => [internal] load .dockerignore                                                                                                                                  0.1s
 => => transferring context: 2B                                                                                                                                    0.0s
 => [internal] load metadata for docker.io/library/centos:latest                                                                                                   1.9s
 => CACHED [1/6] FROM docker.io/library/centos@sha256:a27fd8080b517143cbbbab9dfb7c8571c40d67d534bbdee55bd6c473f432b177                                             0.0s
 => [internal] load build context                                                                                                                                  0.1s
 => => transferring context: 95B                                                                                                                                   0.0s
 => ERROR [2/6] RUN dnf install openssh-server                                                                                                                     2.0s
------
 > [2/6] RUN dnf install openssh-server:
#0 1.808 Error: Failed to download metadata for repo 'appstream': Cannot prepare internal mirrorlist: No URLs in mirrorlist
#0 1.809 CentOS Linux 8 - AppStream                       67  B/s |  38  B     00:00
------
failed to solve: process "/bin/sh -c dnf install openssh-server" did not complete successfully: exit code: 1
[jenkins@localhost jenkins-data]$ cd
[jenkins@localhost ~]$
[jenkins@localhost ~]$
[jenkins@localhost ~]$ ping google.com
PING google.com (142.250.199.142) 56(84) bytes of data.
64 bytes from bom07s36-in-f14.1e100.net (142.250.199.142): icmp_seq=1 ttl=117 time=9.28 ms
64 bytes from bom07s36-in-f14.1e100.net (142.250.199.142): icmp_seq=2 ttl=117 time=9.03 ms
Score:0
jp flag

The centos docker image is marked as depreciated and no longer supported/maintained.

sparsh610 avatar
cu flag
Can i use any other image to create remote host ?
jp flag
You can replace `centos` with `rockylinux:8` image.
I sit in a Tesla and translated this thread with Ai:

mangohost

Post an answer

Most people don’t grasp that asking a lot of questions unlocks learning and improves interpersonal bonding. In Alison’s studies, for example, though people could accurately recall how many questions had been asked in their conversations, they didn’t intuit the link between questions and liking. Across four studies, in which participants were engaged in conversations themselves or read transcripts of others’ conversations, people tended not to realize that question asking would influence—or had influenced—the level of amity between the conversationalists.