NilsIrl / dockerc

container image to single executable compiler
GNU General Public License v3.0
2.74k stars 40 forks source link

Can't chown/chmod files #6

Closed NilsIrl closed 1 day ago

NilsIrl commented 5 months ago

When the postgres image tries to chown/chmod files things fail. Not sure what the fix is. Probably related to overlayfs

Also doesn't work with pivotalrabbitmq/perf-test

NilsIrl commented 5 months ago

We're not the first to hit this issue: https://github.com/docker-library/postgres/issues/116

NilsIrl commented 5 months ago

Tried without overlayfs and had the same issue.

kskarthik commented 5 months ago

tried running nginx image:

Looks like i have similar issue

Am i doing it right, or need to pass any flags ?


sk@moon:~$ ./n
/docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
/docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
/docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
10-listen-on-ipv6-by-default.sh: info: Getting the checksum of /etc/nginx/conf.d/default.conf
10-listen-on-ipv6-by-default.sh: info: Enabled listen on IPv6 in /etc/nginx/conf.d/default.conf
/docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
/docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
/docker-entrypoint.sh: Configuration complete; ready for start up
2024/03/07 17:48:25 [emerg] 1#1: chown("/var/cache/nginx/client_temp", 101) failed (22: Invalid argument)
nginx: [emerg] chown("/var/cache/nginx/client_temp", 101) failed (22: Invalid argument)
sk@moon:~$ 
NilsIrl commented 5 months ago

For now you could inspire yourself from what people have come up for postgres: https://github.com/docker-library/postgres/issues/116

You probably want to pass -v when calling ./n in order to bind some directories between the "host" and the container otherwise the container will not have access to your files.

kskarthik commented 5 months ago

@NilsIrl thank you! I was able to start the nginx with these flags but feels like nginx port binding is not applied to host ports


sk@moon:~$ ./n -s reload -v ~/nvar:/var/cache/nginx -v ~/nvar/run:/var/run &
[1] 4308
sk@moon:~$ /docker-entrypoint.sh: /docker-entrypoint.d/ is not empty, will attempt to perform configuration
/docker-entrypoint.sh: Looking for shell scripts in /docker-entrypoint.d/
/docker-entrypoint.sh: Launching /docker-entrypoint.d/10-listen-on-ipv6-by-default.sh
10-listen-on-ipv6-by-default.sh: info: Getting the checksum of /etc/nginx/conf.d/default.conf
10-listen-on-ipv6-by-default.sh: info: Enabled listen on IPv6 in /etc/nginx/conf.d/default.conf
/docker-entrypoint.sh: Launching /docker-entrypoint.d/20-envsubst-on-templates.sh
/docker-entrypoint.sh: Launching /docker-entrypoint.d/30-tune-worker-processes.sh
/docker-entrypoint.sh: Configuration complete; ready for start up
2024/03/11 05:53:56 [notice] 1#1: signal process started
NilsIrl commented 5 months ago

nginx port binding is not applied to host ports

This probably depends on your nginx configuration. Are you sure that you are using the correct port number? Are you sure the interface is correct?

I doubt it would be able to bind to port 80 without extra permissions.

kskarthik commented 5 months ago

Are you sure the interface is correct?

I did not change anything in the nginx config, just trying to use it as is.

NilsIrl commented 5 months ago

What nginx image are you using?

kskarthik commented 5 months ago

sk@moon:~$ dockerc --image docker://nginx --output nginx

NilsIrl commented 1 day ago

This has been fixed in the latest release as long as you have the uidmap package / newuidmap/newgidmap binaries installed. Otherwise if running the executable as root it should also work.