Comments (11)
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.
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.
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.
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.
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.
There is already a pull request open for removing OpenRC and other unneeded bits. I'd follow #32.
from docker-alpine.
👍
from docker-alpine.
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.
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.
@acoul was that built on top of @neeravkumar 's alpine-openrc image? Also, could you provide an example Dockerfile?
from docker-alpine.
sorry, can't recall.
I mainly use alpine linux on usb flash/keys for old 32bit laptops
from docker-alpine.
Related Issues (20)
- gliderlabs.com does not hav a valid DNS, so docker builds with thie base image fail HOT 2
- Require image for ARM64 architecture HOT 1
- Issue in minikube docker --> ERROR: http://nl.alpinelinux.org/alpine/v3.5/main: DNS lookup error HOT 1
- Time zone is really necessary?
- Issues with wget/apk in alpine:3.13.0 and up
- dl-cdn.alpinelinux.org was offline (12:18:56am Tuesday, 15 February 2022 gmt ~ 2:52:10am Tuesday, 15 February 2022) HOT 27
- Error 503 Backend is unhealthy HOT 12
- ERROR: unable to select packages: curl (no such package): required by: world[curl] Cleaning up file based variables HOT 1
- apk updates are failing 3.15,3.17 - ERROR: https://dl-cdn.alpinelinux.org/alpine/v3.17/main: temporary error (try again later) HOT 1
- Package Manager Broken (apk update: temporary error) HOT 1
- Some guide for install docker alpine on android device HOT 1
- Issues accessing https://dl-cdn.alpinelinux.org HOT 3
- Build mono fail in docker alpine with Segmentation fault
- My
- Slow internet, bad signature errors
- ccccccjtgkneuknjkdtekjjnhnhhivnbehlhjcudfejr HOT 1
- Nslookup doesn't work in github actions HOT 2
- dcps
- alpine:latest can't use hostname to find a server.
- building docker compose in VM Ubuntu
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from docker-alpine.