Comments (11)
Can you explain a little bit more? Or give a full example in order to assess if it's worth it or not?
from s6-overlay.
Better example: service wont run without log directory - for ex. nginx. I mount volume /var/log - for first time its completely empty and directory /var/log/nginx is missing, nginx wont run until i create it with proper rights.
- it would be nice to have some flag in fix-attrs, which will automaticaly run mkdir -p /var/log/nginx if directory not exists
- or/and have ability to run a script BEFORE fix-attrs which will run mkdir -p /var/log/nginx
from s6-overlay.
I would post a patch but execlineb is not my favorite language yet :)
from s6-overlay.
@analogic sorry for the delay, right now, i don't have much time to invest on the overlay. Have you thought on making them in your container before building it up?
Something like this (take a look to /var/log/{nginx-access-logs,nginx-error-logs}
): https://github.com/just-containers/nginx-loadbalancer
WDYT?
from s6-overlay.
@analogic any news on this?
from s6-overlay.
Sorry for delay - nginx was only for example - there are other services which needs precreate directories with proper rights. I am author of https://hub.docker.com/r/analogic/poste.io/ and handling directories which are exposed to users is kind of complex task. :) I will write patch when i will have some time...
from s6-overlay.
My nginx references were an example too. I pre-create folders within the rootfs before building the image itself, it's more declarative and seems cleaner, at least for me. Give it a try and tell me what you think and if this doesn't fit explain your use-case a little bit more. Image sources would help of course.
from s6-overlay.
Technicaly my image is blackbox with only datadir/logs exposed via volumes - rootfs is not problem at all. Mainly i am solving first container run (precreating needed directories), fixing user errors (deletion some of a logs dir) or updates in datadir structure... its no big deal, but it would be nice to switch all this handling from custom script to simple fix-attrs
from s6-overlay.
What about something like this (this is the way it was done in nginx-loadbalancer):
mysql-data-image/Dockerfile:
FROM busybox
VOLUME /var/lib/mysql
COPY rootfs /
CMD ["true"]
mysql-data-image/rootfs/var/lib/mysql/test-file:
buh from a data container
Then:
docker build -t mysql-data-image .
docker run --name mysql-data mysql-data-image
docker run --rm --volumes-from mysql-data quay.io/justcontainers/mariadb:v0.4.0 cat /var/lib/mysql/test-file
Among other things this is printed to the stdout:
[...]
buh from a data container
cat exited 0
[...]
from s6-overlay.
@analogic please close this whenever you can.
from s6-overlay.
sorry, i am bit busy right now... ill do patch later
from s6-overlay.
Related Issues (20)
- systemd notify service conversion exmaple HOT 4
- s6-notifyoncheck: fatal: s6-supervise not running. HOT 3
- Installing S6 on official php-fpm container shows no log output from S6 HOT 5
- Issue with s6-overlay in Cattr project when deployed on Kubernetes HOT 6
- `UID not set` error HOT 10
- Question: pass args to the underlying service HOT 6
- s6-overlay v3 only sends SIGTERM to `/etc/services.d` after `S6_SERVICES_GRACETIME` HOT 8
- Setting S6_READ_ONLY_ROOT does not copy `/etc` to `/run/s6/etc` HOT 3
- Service is started, but reported as "normally down", seemingly by default HOT 11
- 3.1.6.1 hangs at the very end of shutdown for more than a minute HOT 3
- In some rare occasions s6-overlay hangs at shutdown for undefined amount of time HOT 4
- Using s6-overlay with ECS Exec HOT 8
- How to create something similar like cont-init if this one is deprecated ? HOT 3
- Best practice for redirecting output from app1 to app2 HOT 5
- Problem using S6_STAGE2_HOOK to run shell script HOT 2
- s6-linux-init: warning: parent wrote to fd 3! HOT 9
- How to read ENV variables from a file for the main process (defined in CMD) HOT 4
- Shutdown container during s6-rc startup leads to deadlock HOT 3
- finish script does not receive system.exit code but 0 HOT 33
- Cannot make Log to stdout work with s6-overlay 3.1.6.2 (no bug, just looking for some guidance/help). HOT 3
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 s6-overlay.