Giter VIP home page Giter VIP logo

docker-rockylinux-systemd's People

Contributors

eniocarboni avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

docker-rockylinux-systemd's Issues

rockylinux:9 missing /usr/sbin/init

On rockylinux:9 is missing /usr/sbin/init, so Docker image don't start.

Error starting container aeb98b53... 400 Client Error for http+docker://localhost... failed to create shim task: OCI runtime create failed: runc create failed: unable to start container process: exec: \"/usr/sbin/init\": stat /usr/sbin/init: no such file or directory

see rocky-linux/sig-cloud-instance-images#39

not work after try

Hi
can you help

 sudo systemctl status nginx
System has not been booted with systemd as init system (PID 1). Can't operate.
Failed to connect to bus: Host is down

here my config

---
dependency:
  name: galaxy
driver:
  name: docker
platforms:
  # - name: centos7
    # image: milcom/centos7-systemd
  - name: rocky8
    image: eniocarboni/docker-rockylinux-systemd:latest 
    volumes:
      - /sys/fs/cgroup:/sys/fs/cgroup:ro
    privileged: true
provisioner:
  name: ansible
verifier:
  name: ansible
``

How can I use this image in a docker compose context ?

Hi. This isn't really an issue. Feel free to close if it bothers you. Since there is no discussions section I'm posting here.

I'm trying to setup a docker environment that has a Red Hat 9 clone with the latest version of mongo and nginx, started as systemd services on which I can just get a shell or run diverse tests for a piece of software.

My current dockerfile is

FROM eniocarboni/docker-rockylinux-systemd
ENV container docker

RUN curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.3/install.sh | bash
RUN echo -e "[mongodb-org-6.0]\nname=MongoDB Repository \nbaseurl=https://repo.mongodb.org/yum/redhat/9/mongodb-org/6.0/x86_64/ \ngpgcheck=1 \nenabled=1 \ngpgkey=https://www.mongodb.org/static/pgp/server-6.0.asc" > /etc/yum.repos.d/mongodb-org-6.0.repo

RUN dnf -y clean all && dnf -y group install "Development Tools" && dnf -y install mongodb-org nginx procps-ng; rm -rf /var/cache /var/log/dnf* /var/log/yum.*

RUN mkdir -p /data/db
RUN chmod -R 777 /data/db
VOLUME [ "/data/db" ]
EXPOSE 27017
RUN systemctl enable --now mongod

RUN . ~/.nvm/nvm.sh && nvm install --lts

EXPOSE 80
RUN systemctl enable --now nginx

COPY docker-entrypoint.sh /usr/local/bin/
RUN ["chmod", "+x", "/usr/local/bin/docker-entrypoint.sh"]
ENTRYPOINT ["docker-entrypoint.sh"]

docker-entrypoint.sh is:

#!/usr/bin/env bash

tail -f /dev/null

and docker-compose.yml is:

services:
  application:
    build: .
    privileged: true
    container_name: application
    ports:
      - 27017:27017
      - 80:80
    volumes:
      - /sys/fs/cgroup:/sys/fs/cgroup:ro
      - /mnt/application/data/db:/data/db:rw

They're all in the same folder. I just run: docker compose up -d --build --remove-orphans. The weird mounts are because of WSL, docker runs in WSL. I get this errore which I've already googled and looked at the rockylinux/almalinux/9-init github issue trackers to no avail.

 => ERROR [ 7/11] RUN systemctl enable --now mongod                                                                                                                                    0.4s
------
 > [ 7/11] RUN systemctl enable --now mongod:
#0 0.366 System has not been booted with systemd as init system (PID 1). Can't operate.
#0 0.366 Failed to connect to bus: Host is down
------
failed to solve: executor failed running [/bin/sh -c systemctl enable --now mongod]: exit code: 1

How would I get over this ? Could you point me in the right direction ? I can get this working by just starting mongodb and nginx with (mongod &) && (nginx &) && tail... but I need systemd

/bin/sh: /usr/bin/rm: /usr/bin/coreutils: bad interpreter: No such file or directory

STEP 1/5: FROM rockylinux:9
Resolved "rockylinux" as an alias (/etc/containers/registries.conf.d/000-shortnames.conf)
Trying to pull docker.io/library/rockylinux:9...
Getting image source signatures
Copying blob 9d28f3f24f51 skipped: already exists
Copying config 656f801c02 done
Writing manifest to image destination
Storing signatures
STEP 2/5: ENV container docker
--> 7eed84af90b
STEP 3/5: RUN (cd /lib/systemd/system/sysinit.target.wants/; for i in ; do [ $i == systemd-tmpfiles-setup.service ] || rm -f $i; done); rm -f /lib/systemd/system/multi-user.target.wants/;rm -f /etc/systemd/system/.wants/;rm -f /lib/systemd/system/local-fs.target.wants/; rm -f /lib/systemd/system/sockets.target.wants/udev; rm -f /lib/systemd/system/sockets.target.wants/initctl; rm -f /lib/systemd/system/basic.target.wants/;rm -f /lib/systemd/system/anaconda.target.wants/;
/bin/sh: line 1: cd: /lib/systemd/system/sysinit.target.wants/: No such file or directory
rm: cannot remove 'afs': Is a directory
rm: cannot remove 'dev': Is a directory
rm: cannot remove 'etc': Is a directory
rm: cannot remove 'home': Is a directory
/bin/sh: /usr/bin/rm: /usr/bin/coreutils: bad interpreter: No such file or directory
/bin/sh: /usr/bin/rm: /usr/bin/coreutils: bad interpreter: No such file or directory
/bin/sh: /usr/bin/rm: /usr/bin/coreutils: bad interpreter: No such file or directory
/bin/sh: /usr/bin/rm: /usr/bin/coreutils: bad interpreter: No such file or directory
/bin/sh: /usr/bin/rm: /usr/bin/coreutils: bad interpreter: No such file or directory
/bin/sh: /usr/bin/rm: /usr/bin/coreutils: bad interpreter: No such file or directory
/bin/sh: /usr/bin/rm: /usr/bin/coreutils: bad interpreter: No such file or directory
/bin/sh: /usr/bin/rm: /usr/bin/coreutils: bad interpreter: No such file or directory
/bin/sh: /usr/bin/rm: /usr/bin/coreutils: bad interpreter: No such file or directory
/bin/sh: /usr/bin/rm: /usr/bin/coreutils: bad interpreter: No such file or directory
/bin/sh: /usr/bin/rm: /usr/bin/coreutils: bad interpreter: No such file or directory
/bin/sh: /usr/bin/rm: /usr/bin/coreutils: bad interpreter: No such file or directory
/bin/sh: /usr/bin/rm: /usr/bin/coreutils: bad interpreter: No such file or directory
/bin/sh: /usr/bin/rm: /usr/bin/coreutils: bad interpreter: No such file or directory
/bin/sh: /usr/bin/rm: /usr/bin/coreutils: bad interpreter: No such file or directory
/bin/sh: /usr/bin/rm: /usr/bin/coreutils: bad interpreter: No such file or directory
/bin/sh: /usr/bin/rm: /usr/bin/coreutils: bad interpreter: No such file or directory
/bin/sh: /usr/bin/rm: /usr/bin/coreutils: bad interpreter: No such file or directory
/bin/sh: /usr/bin/rm: /usr/bin/coreutils: bad interpreter: No such file or directory
/bin/sh: /usr/bin/rm: /usr/bin/coreutils: bad interpreter: No such file or directory
Error: error building at STEP "RUN (cd /lib/systemd/system/sysinit.target.wants/; for i in ; do [ $i == systemd-tmpfiles-setup.service ] || rm -f $i; done); rm -f /lib/systemd/system/multi-user.target.wants/;rm -f /etc/systemd/system/
.wants/;rm -f /lib/systemd/system/local-fs.target.wants/; rm -f /lib/systemd/system/sockets.target.wants/udev; rm -f /lib/systemd/system/sockets.target.wants/initctl; rm -f /lib/systemd/system/basic.target.wants/;rm -f /lib/systemd/system/anaconda.target.wants/;": error while running runtime: exit status 126

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.