linuxserver / docker-librespeed

GNU General Public License v3.0
76 stars 9 forks source link

add env var for librespeed port #3

Closed scyto closed 4 years ago

scyto commented 4 years ago

linuxserver.io

If you are new to Docker or this application our issue tracker is ONLY used for reporting bugs or requesting features. Please use our discord server for general support.

I want to leverage this multiarch build to run on a switch that doesn't support lopback this means it needs to be run with --network=host however port 80 already has something on it I need to be able to set an arbitrary port for the librespeed to run natively on

Expected Behavior

docker --rm -it --network=host -e PORT=8000 should result in a running container with librespeed running on port 8000

Current Behavior

there is no envar for port so this is not possible

Steps to Reproduce

docker --rm -it --network=host -e PORT=8000 doesn't run this on port 8000, it just runs on default of 80

Environment

UniFiOS (custom linux build)
CPU architecture: arm64 How docker service was installed:
It is actually podman not docker, but that shouldn't be too relevant, as podman can be aliased to docker and all commands work, the issue comes from how the platform holder decided to setup the container env itself - bridge networking does not work so i can't remap port using -p .

Command used to create docker container (run/create/compose/screenshot)

docker --rm -it --network=host -e PORT=8000 linuxserver/librespeed

Docker logs

# sudo podman run --rm -it --network=host  linuxserver/librespeed
[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] 20-config: executing... 
[cont-init.d] 20-config: exited 0.
[cont-init.d] 30-keygen: executing... 
generating self-signed keys in /config/keys, you can replace these with your own keys if required
Generating a RSA private key
..................................................+++++
...............+++++
writing new private key to '/config/keys/cert.key'
-----
[cont-init.d] 30-keygen: exited 0.
[cont-init.d] 50-config: executing... 
Setting permissions
[cont-init.d] 50-config: 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
s6-supervise cron: warning: unable to spawn ./run - waiting 10 seconds
s6-supervise (child): fatal: unable to exec run: Permission denied
s6-supervise php-fpm: warning: unable to spawn ./run - waiting 10 seconds
s6-supervise (child): fatal: unable to exec run: Permission denied
s6-supervise (child): fatal: unable to exec run: Permission denied
s6-supervise nginx: warning: unable to spawn ./run - waiting 10 seconds
[services.d] done.
s6-supervise (child): fatal: unable to exec run: Permission denied
s6-supervise cron: warning: unable to spawn ./run - waiting 10 seconds
s6-supervise php-fpm: warning: unable to spawn ./run - waiting 10 seconds
s6-supervise (child): fatal: unable to exec run: Permission denied
s6-supervise nginx: warning: unable to spawn ./run - waiting 10 seconds
s6-supervise (child): fatal: unable to exec run: Permission denied
s6-supervise cron: warning: unable to spawn ./run - waiting 10 seconds
s6-supervise (child): fatal: unable to exec run: Permission denied
s6-supervise php-fpm: warning: unable to spawn ./run - waiting 10 seconds
s6-supervise (child): fatal: unable to exec run: Permission denied
s6-supervise nginx: warning: unable to spawn ./run - waiting 10 seconds
s6-supervise (child): fatal: unable to exec run: Permission denied
s6-supervise cron: warning: unable to spawn ./run - waiting 10 seconds
s6-supervise (child): fatal: unable to exec run: Permission denied
s6-supervise php-fpm: warning: unable to spawn ./run - waiting 10 seconds
s6-supervise (child): fatal: unable to exec run: Permission denied
s6-supervise nginx: warning: unable to spawn ./run - waiting 10 seconds
s6-supervise (child): fatal: unable to exec run: Permission denied
aptalca commented 4 years ago

It is quite strange that your OS doesn't support bridge networking with docker.

But, you can easily change the port by modifying the listen port in the default site conf. It is at /config/nginx/site-confs/default https://github.com/linuxserver/docker-librespeed/blob/master/root/defaults/default#L4

The errors you are seeing in the log are podman related (podman != docker). If you search through our github repo issues, you'll see some potential fixes.

scyto commented 4 years ago

Yes it is strange :-) - its because really podman is there for running their stuff nor userland stuff (it is a router). Thanks, will try those suggestions, will close and open new issue if needed.

maxexcloo commented 11 months ago

It is quite strange that your OS doesn't support bridge networking with docker.

But, you can easily change the port by modifying the listen port in the default site conf. It is at /config/nginx/site-confs/default https://github.com/linuxserver/docker-librespeed/blob/master/root/defaults/default#L4

The errors you are seeing in the log are podman related (podman != docker). If you search through our github repo issues, you'll see some potential fixes.

Sorry to bring this up again but I'm having a similar issue, the path you linked doesn't seem to be current anymore - is there another way to do this?

aptalca commented 11 months ago

That file is now injected by the baseimage, but you can find it at /config/nginx/site-confs/default.conf You'll see the listen ports in there