Community discussions

MikroTik App
 
elico
Member Candidate
Member Candidate
Topic Author
Posts: 143
Joined: Mon Nov 07, 2016 3:23 am

/dev/stdout and /dev/stderr permission denied on many containers

Mon Nov 14, 2022 10:42 pm

Hey,

I wanted to run a PHP based service inside a container on my RB4011.
The image I found that is compatible and slim is:
https://github.com/erseco/alpine-php-webserver

There are couple issues that are preventing the container from operation.
The first is that it's tries to write into /dev/stderr and /dev/stdout.
To resolve this I have changed the default nginx.conf and www.conf.
I assumed that like any other container I can use a file as a mount.
So the container is defined with:
/container mounts
add dst=/var/log/nginx name=php_log src=/disk1/php/log
add dst=/var/www/html name=php_html src=/disk1/php/html
add dst=/etc/nginx/nginx.conf name=php_nginx_conf src=/disk1/nginx.conf
add dst=/etc/php81/php-fpm.d/www.conf name=php_fpm_www_conf src=/disk1/www.conf
add dst=/tmp name=php_tmp src=/disk1/php/tmp
/container
add envlist=php_envs interface=veth3 mounts=php_log,php_html,php_nginx_conf,php_fpm_www_conf,php_tmp root-dir=disk1/php workdir=\
    /var/www/html
/container config
set registry-url=https://registry-1.docker.io tmpdir=disk1/pull
/container envs
add key=TZ name=php_envs value=Asia/Jerusalem
But then I see in the logs the next log lines:
Starting runit...
Started runsvdir, PID is 5
wait for processes to start....
mv: can't remove '/etc/nginx/nginx.conf': Resource busy
mv: can't remove '/etc/php81/php-fpm.d/www.conf': Resource busy
mv: can't remove '/etc/nginx/nginx.conf': Resource busy
mv: can't remove '/etc/php81/php-fpm.d/www.conf': Resource busy
... couple times
down: nginx: 1s, normally up, want up
down: php: 1s, normally up, want up
... and repeats
(how am I suppose to copy the log lines from winbox??)

I am trying to understand if the only way to customize the container is using a tar file.
I assumed I can mount files the same as directories since it makes sense to me.
Is the only way to customize the container conf files is at creation time?
Is there a way to copy customized config files into the container?

Thanks,
 
User avatar
antonsb
MikroTik Support
MikroTik Support
Posts: 385
Joined: Sun Jul 24, 2016 3:12 pm
Location: Riga, Latvia

Re: /dev/stdout and /dev/stderr permission denied on many containers

Tue Nov 15, 2022 1:53 pm

/dev/stdout and /dev/stderr permissions are fixed in latest beta releases (starting from 7.7beta6)

mounting files instead of folders are not yet implemented.
 
tangent
Forum Guru
Forum Guru
Posts: 1330
Joined: Thu Jul 01, 2021 3:15 pm
Contact:

Re: /dev/stdout and /dev/stderr permission denied on many containers

Tue Nov 15, 2022 2:05 pm

mounting files instead of folders are not yet implemented.

Until that lack is filled, you can copy all the files out of the directory in the image containing the one you want to modify, make your changes, and then mount the changed directory over the top of the original.

Containers implement a union file system. It’s perfectly legal to have overlapping file names. The uppermost level wins.

Who is online

Users browsing this forum: No registered users and 3 guests