Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Applying mod to nginx image fails #13

Closed
pagdot opened this issue Feb 17, 2020 · 7 comments
Closed

Applying mod to nginx image fails #13

pagdot opened this issue Feb 17, 2020 · 7 comments
Assignees

Comments

@pagdot
Copy link

pagdot commented Feb 17, 2020

Applying a mod to the nginx image fails with:

nginx        | [mod-init] Attempting to run Docker Modification Logic
nginx        | [mod-init] Applying pagdot/nginx-reverse-mod files to container
nginx        | tar: invalid magic
nginx        | tar: short read

According to a question on unix stackexchange the tar binary from alpines busybox doesn"t support a necessary feature

@aptalca
Copy link
Member

aptalca commented Feb 17, 2020

Can you share more info on what the mod is? The dockerfile for it?

@pagdot
Copy link
Author

pagdot commented Feb 17, 2020

@aptalca
Copy link
Member

aptalca commented Feb 17, 2020

I'll look into it more in a bit. But with regards to alpine not working, it does work with our mod system as the openssh-server mods listed are alpine based: https://github.com/linuxserver/docker-mods/blob/openssh-server-rsync/root/etc/cont-init.d/99-rsync#L4

@aptalca aptalca self-assigned this Feb 17, 2020
@thelamer
Copy link
Member

You need to include a tag with the env var DOCKER_MODS so use:

-e DOCKER_MODS=pagdot/nginx-reverse-mod:latest

@pagdot
Copy link
Author

pagdot commented Feb 18, 2020

@thelamer Of course, else it would't even try to install the mod as shown in the log above

@thelamer
Copy link
Member

I didn't just close this without testing it works fine on my end:

docker run --rm -it -e DOCKER_MODS=pagdot/nginx-reverse-mod:latest lsiobase/alpine:3.11 bash
[mod-init] Curl was not found on this system for Docker mods installing
fetch http://dl-cdn.alpinelinux.org/alpine/v3.11/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.11/community/x86_64/APKINDEX.tar.gz
(1/3) Installing nghttp2-libs (1.40.0-r0)
(2/3) Installing libcurl (7.67.0-r0)
(3/3) Installing curl (7.67.0-r0)
Executing busybox-1.31.1-r9.trigger
OK: 24 MiB in 31 packages
[mod-init] Attempting to run Docker Modification Logic
[mod-init] Applying pagdot/nginx-reverse-mod:latest files to container
[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.
[cont-init.d] executing container initialization scripts...
[cont-init.d] 01-envfile: executing... 
[cont-init.d] 01-envfile: exited 0.
[cont-init.d] 10-adduser: executing... 
usermod: no changes

-------------------------------------
          _         ()
         | |  ___   _    __
         | | / __| | |  /  \ 
         | | \__ \ | | | () |
         |_| |___/ |_|  \__/


Brought to you by linuxserver.io
We gratefully accept donations at:
https://www.linuxserver.io/donate/
-------------------------------------
GID/UID
-------------------------------------

User uid:    911
User gid:    911
-------------------------------------

[cont-init.d] 10-adduser: exited 0.
[cont-init.d] 25-config-reverse: executing... 
Creating DH parameters for additional security. This may take a very long time. There will be another message once this process is completed
/var/run/s6/etc/cont-init.d/25-config-reverse: line 16: openssl: command not found
DH parameters successfully created -  bits
[cont-init.d] 25-config-reverse: exited 0.
[cont-init.d] 99-custom-files: executing... 
[custom-init] no custom files found exiting...
[cont-init.d] 99-custom-files: exited 0.
[cont-init.d] done.
[services.d] starting services
[services.d] done.
root@eb2e42baac27:/# ls -l /defaults/
total 36
-rw-rw-r-- 1 root root  3027 Feb 15 16:28 default
-rw-rw-r-- 1 root root  4140 Feb 15 16:28 ldap.conf
-rw-rw-r-- 1 root root  1892 Feb 15 16:28 nginx.conf
drwxr-xr-x 2 root root 12288 Feb 18 21:31 proxy-confs
-rw-rw-r-- 1 root root  1073 Feb 15 16:28 proxy.conf
-rw-rw-r-- 1 root root  1602 Feb 15 16:28 ssl.conf

@pagdot
Copy link
Author

pagdot commented Feb 19, 2020

I've got it working. I forgot to add a tag to the mod image. Would it be possible to automatically choose "latest" or at least print a warning or an error?

Sample triggering this error:

$ docker run --rm -it -e DOCKER_MODS=pagdot/nginx-reverse-mod lsiobase/alpine:3.11 bash
Unable to find image 'lsiobase/alpine:3.11' locally
3.11: Pulling from lsiobase/alpine
7a6daffa09ba: Pull complete 
faf9ecdaab4b: Pull complete 
e2f177c3a31b: Pull complete 
Digest: sha256:49dcfdc686285ad66614bda40189e9a62cc56972e2eb21cc3ceeedb07ea84550
Status: Downloaded newer image for lsiobase/alpine:3.11
[mod-init] Curl was not found on this system for Docker mods installing
fetch http://dl-cdn.alpinelinux.org/alpine/v3.11/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.11/community/x86_64/APKINDEX.tar.gz
(1/3) Installing nghttp2-libs (1.40.0-r0)
(2/3) Installing libcurl (7.67.0-r0)
(3/3) Installing curl (7.67.0-r0)
Executing busybox-1.31.1-r9.trigger
OK: 24 MiB in 31 packages
[mod-init] Attempting to run Docker Modification Logic
[mod-init] Applying pagdot/nginx-reverse-mod files to container
tar: invalid magic
tar: short read
[s6-init] making user provided files available at /var/run/s6/etc...exited 0.
[s6-init] ensuring user provided files have correct perms...exited 0.
[fix-attrs.d] applying ownership & permissions fixes...
[fix-attrs.d] done.

labmonkey added a commit to labmonkey/docker-mods that referenced this issue Mar 18, 2024
# This is the 1st commit message:

Updated requirements in the Readme to mention docker dependencies

# This is the commit message linuxserver#2:

Improve the way mod behaves after restart where config directory disappears by recreating the config file (prevent unneccesary update in the api)

# This is the commit message linuxserver#3:

debug

# This is the commit message linuxserver#4:

fix

# This is the commit message linuxserver#5:

fix

# This is the commit message linuxserver#6:

fix

# This is the commit message linuxserver#7:

fix

# This is the commit message linuxserver#8:

fix

# This is the commit message linuxserver#9:

fix

# This is the commit message linuxserver#10:

Refactor whole code (same functionality)

# This is the commit message linuxserver#11:

fix

# This is the commit message linuxserver#12:

fix

# This is the commit message linuxserver#13:

fix

# This is the commit message linuxserver#14:

fix

# This is the commit message linuxserver#15:

fix

# This is the commit message linuxserver#16:

fix

# This is the commit message linuxserver#17:

fix

# This is the commit message linuxserver#18:

fix everything with pylint

# This is the commit message linuxserver#19:

fix

# This is the commit message linuxserver#20:

fix

# This is the commit message linuxserver#21:

fix

# This is the commit message linuxserver#22:

fix

# This is the commit message linuxserver#23:

fix

# This is the commit message linuxserver#24:

fix

# This is the commit message linuxserver#25:

fix

# This is the commit message linuxserver#26:

fix

# This is the commit message linuxserver#27:

fix

# This is the commit message linuxserver#28:

fix

# This is the commit message linuxserver#29:

fix

# This is the commit message linuxserver#30:

added monitor param

# This is the commit message linuxserver#31:

added support for notifications

# This is the commit message linuxserver#32:

fix

# This is the commit message linuxserver#33:

fix

# This is the commit message linuxserver#34:

fix

# This is the commit message linuxserver#35:

fix

# This is the commit message linuxserver#36:

fix

# This is the commit message linuxserver#37:

added note about defaults
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants