Giter VIP home page Giter VIP logo

Comments (5)

itzg avatar itzg commented on June 19, 2024

IMHO Docker has never done a good job with volume attachments and non-root container execution. If you test with this, I'm guessing you'll find the volume's directory is owned/writable by root:

docker run -it -v ~/data_bungee:/server --user $(id -u) --rm --entrypoint bash itzg/bungeecord -c "ls -al /server"

itzg/minecraft-server works because I have the startup script jump through hoops to adapt to the user and file ownership:

https://github.com/itzg/docker-minecraft-server/blob/master/start#L8-L37

If you really want a non-root user within the container, then you'll need to modify the file ownership of your host directory ~/data_bungee to match $(id -u).

from docker-bungeecord.

iverly avatar iverly commented on June 19, 2024

Even when changing the ownership of the host file, curl still returns the same error. The solution I found is to manually download Bungeecord.jar and launch the container.

Do you think you can implement the same script as in itzg/minecraft-server ?

from docker-bungeecord.

itzg avatar itzg commented on June 19, 2024

Can you provide the output of

docker run -it -v ~/data_bungee:/server --user $(id -u) --rm --entrypoint bash itzg/bungeecord -c "ls -al /server"

Without confirming the scenario Iā€™m not sure that the same entry point solution would work.

from docker-bungeecord.

iverly avatar iverly commented on June 19, 2024
iverly@docker-1:~$ mkdir data_bungee/
iverly@docker-1:~$ docker run -it -v ~/data_bungee:/server --user $(id -u) --rm --entrypoint bash itzg/bungeecord -c "ls -al /server"
total 8
drwxr-xr-x    2 1001     1002          4096 Apr 28 08:08 .
drwxr-xr-x    1 root     root          4096 Apr 28 08:08 ..

from docker-bungeecord.

itzg avatar itzg commented on June 19, 2024

I finally got a chance to debug this, but I haven't been able to recreate it.

I added a user:

sudo useradd mc
$ id mc
uid=1001(mc) gid=1002(mc) groups=1002(mc)

Made a directory and changed ownership

mkdir ~/mc-data
sudo chown -R mc: mc-data

and started bungeecord

$ docker run -it -v ~/mc-data:/server --user 1001 itzg/bungeecord
Resolving type given BUNGEECORD
Downloading https://ci.md-5.net/job/BungeeCord/lastStableBuild/artifact/bootstrap/target/BungeeCord.jar
Setting initial memory to 512m and max to 512m
14:56:14 [INFO] Using mbed TLS based native cipher.
14:56:14 [INFO] Using zlib based native compressor.
14:56:14 [INFO] Enabled BungeeCord version git:BungeeCord-Bootstrap:1.15-SNAPSHOT:b85df4f:1495
14:56:14 [INFO] Not on Windows, attempting to use enhanced EpollEventLoop
14:56:14 [INFO] Epoll is working, utilising it!
.
.
.

Files have expected ownership

$ ls -aln ~/mc-data
total 10568
drwxr-xr-x 4 1001 1002     4096 May  2 09:56 .
drwxr-xr-x 8 1000 1000     4096 May  2 09:54 ..
-rw-r--r-- 1 1001    0 10785372 May  2 09:56 BungeeCord-lastStableBuild.jar
-rw-r--r-- 1 1001    0     1095 May  2 09:56 config.yml
-rw-r--r-- 1 1001    0        3 May  2 09:56 locations.yml
drwxr-xr-x 2 1001    0     4096 May  2 09:56 modules
-rw-r--r-- 1 1001    0      155 May  2 09:56 modules.yml
drwxr-xr-x 2 1001    0     4096 May  2 09:56 plugins
-rw-r--r-- 1 1001    0     3935 May  2 09:56 proxy.log.0

It might be something about your networking. You can debug that same download operation it is doing by exec'ing into the container and running the curl:

docker run -it --rm --entrypoint bash itzg/bungeecord
curl -o /tmp/bungee.jar -v https://ci.md-5.net/job/BungeeCord/lastStableBuild/artifact/bootstrap/target/BungeeCord.jar

from docker-bungeecord.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    šŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo 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.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ā¤ļø Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.