Giter Site home page Giter Site logo

Comments (11)

neeravkumar avatar neeravkumar commented on June 16, 2024 18

I know I might be way late but I was able to get openrc to work inside docker:

https://github.com/neeravkumar/dockerfiles/tree/master/alpine-openrc

from docker-alpine.

andyshinn avatar andyshinn commented on June 16, 2024

OpenRC won't work in a container where it is not pid 1. See #26 for similar question. If you really do want an init system, look at the custom one built into the phusion base image. Though, we generally build containers as single processes rather than fat images.

from docker-alpine.

iby avatar iby commented on June 16, 2024

Hey Andy, thanks for response, but it doesn't answer the question or sheds any light. I've figured out that it won't work where it's not PID 1 from the very first message init: must be run as PID 1. Phusion base image is essentially a Ubuntu and has nothing todo with Alpine. I'm aware of other alternatives from this and a few other topics.

From your response I get that OpenRC is not something that used at all inside the container. Is there any reason it's there then or is it part of Alpine that can't be easily removed? In other words why not make the image even lighter without OpenRC if it doesn't provide any value?

from docker-alpine.

progrium avatar progrium commented on June 16, 2024

If it's something that can easily be removed, we should. Feel free to submit a PR.

Just to confirm, we don't support the use of traditional init systems for minimal containers built with Alpine. They make too many assumptions about the system running as a full Linux system, not as a minimal container.

from docker-alpine.

iby avatar iby commented on June 16, 2024

Understood, I saw it as one of a very few things available and thought that's for a reason. Thanks for clearing this up.

from docker-alpine.

andyshinn avatar andyshinn commented on June 16, 2024

There is already a pull request open for removing OpenRC and other unneeded bits. I'd follow #32.

from docker-alpine.

iby avatar iby commented on June 16, 2024

👍

from docker-alpine.

nitintutlani avatar nitintutlani commented on June 16, 2024

To be able to use openrc inside a alpine container, you may try using --privileged attribute to run it.

This is a comparable issue with systemd also and a known docker issue explained here: https://docs.docker.com/v1.2/reference/commandline/cli/

from docker-alpine.

acoul avatar acoul commented on June 16, 2024
680f8a49b903:~# rc-status 
Runlevel: default
 sshd                                                                                                                                                                                                                           [  started  ]
 lighttpd                                                                                                                                                                                                                       [  started  ]
 mariadb                                                                                                                                                                                                                        [  started  ]
Dynamic Runlevel: hotplugged
Dynamic Runlevel: needed/wanted
 root                                                                                                                                                                                                                           [  started  ]
 localmount                                                                                                                                                                                                                     [  started  ]
 fsck                                                                                                                                                                                                                           [  started  ]
Dynamic Runlevel: manual
680f8a49b903:~# ps auxwww
PID   USER     TIME   COMMAND
    1 root       0:00 init
  148 root       0:00 /usr/sbin/sshd
  349 mysql      0:00 /usr/bin/mysqld --basedir=/usr --datadir=/var/lib/mysql --plugin-dir=/usr/lib/mysql/plugin --user=mysql --pid-file=/run/mysqld/mysqld.pid --socket=/run/mysqld/mysqld.sock --port=3306
  350 root       0:00 logger -t mysqld -p daemon.error
  407 lighttpd   0:00 /usr/sbin/lighttpd -f /etc/lighttpd/lighttpd.conf
  409 lighttpd   0:00 /usr/bin/php-cgi
  412 lighttpd   0:00 /usr/bin/php-cgi
  413 lighttpd   0:00 /usr/bin/php-cgi
  414 lighttpd   0:00 /usr/bin/php-cgi
  415 lighttpd   0:00 /usr/bin/php-cgi
  416 lighttpd   0:00 /usr/bin/php-cgi
  417 lighttpd   0:00 /usr/bin/php-cgi
  418 lighttpd   0:00 /usr/bin/php-cgi
  419 root       0:00 sshd: alex [priv]
  421 alex       0:00 sshd: alex@pts/0
  422 alex       0:00 -sh
  423 root       0:00 -ash
  425 root       0:00 ps auxwww

from docker-alpine.

1ma avatar 1ma commented on June 16, 2024

@acoul was that built on top of @neeravkumar 's alpine-openrc image? Also, could you provide an example Dockerfile?

from docker-alpine.

acoul avatar acoul commented on June 16, 2024

sorry, can't recall.

I mainly use alpine linux on usb flash/keys for old 32bit laptops

from docker-alpine.

Related Issues (20)

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.