#docker - October 2019

dockerArchived
48 messages

All things docker
Archive: https://archive.sweetops.com/docker/

October 2019
Nikola Velkovski
Nikola Velkovskiabout 7 years ago
Hi Igor, well it's kinda obvious that the issue is with the user not having enough permissions to start the process.
Nikola Velkovski
Nikola Velkovskiabout 7 years ago
I would suggest you start the process yourself
Nikola Velkovski
Nikola Velkovskiabout 7 years ago
e.g.
Nikola Velkovski
Nikola Velkovskiabout 7 years ago
docker run -it node:10-alpine sh
Nikola Velkovski
Nikola Velkovskiabout 7 years ago
that would start a shell with the user specificed in the USER directive
Nikola Velkovski
Nikola Velkovskiabout 7 years ago
if you need root you can do the following
Nikola Velkovski
Nikola Velkovskiabout 7 years ago
docker run -u 0 -it node:10-alpine sh
Nikola Velkovski
Nikola Velkovskiabout 7 years ago
I guess from there you can deduct what kind of rights does the user node need.
Igor
Igorabout 7 years ago
@Nikola Velkovski Thanks for that. What puzzles me is that the container works on other hosts. At which point do permissions of the user within the container get constrained by the host permissions?
Igor
Igorabout 7 years ago
When I -it into it as root as su as node, everything works fine
Igor
Igorabout 7 years ago
node user has permissions and can run entrypoint and cmd
Nikola Velkovski
Nikola Velkovskiabout 7 years ago
@Igor that is weird indeed, I am usually using debian and alpine, and I haven't encountered similar issues.
Nikola Velkovski
Nikola Velkovskiabout 7 years ago
The only thing I can think of is a MAC software
Nikola Velkovski
Nikola Velkovskiabout 7 years ago
apparmor, SElinux or grsecurity
Nikola Velkovski
Nikola Velkovskiabout 7 years ago
on the host that runs the dockers
Igor
Igorabout 7 years ago
disabled everything selinux, but maybe one of the others
Igor
Igorabout 7 years ago
It's a hardened host
Nikola Velkovski
Nikola Velkovskiabout 7 years ago
but wait there was one aditional step...
Igor
Igorabout 7 years ago
And I have no visibility atm on how it was setup
Nikola Velkovski
Nikola Velkovskiabout 7 years ago
you need to disable it
Nikola Velkovski
Nikola Velkovskiabout 7 years ago
and then either reboot or restart the service..
Nikola Velkovski
Nikola Velkovskiabout 7 years ago
what was it..
Nikola Velkovski
Nikola Velkovskiabout 7 years ago
<thinking>
Igor
Igorabout 7 years ago
Yup, done that, thanks for your input on this
Igor
Igorabout 7 years ago
Just annoying that there is nothing but a single exec user process caused "permission denied" error
Igor
Igorabout 7 years ago
I thought the purpose of docker was to avoid this kind of nonsense 😉
Nikola Velkovski
Nikola Velkovskiabout 7 years ago
haha you wish 🙂
Nikola Velkovski
Nikola Velkovskiabout 7 years ago
it should be the other way around, SElinux is in place just to annoy the hell out of you 🙂
Igor
Igorabout 7 years ago
Igor
Igorabout 7 years ago
Brought down our whole CI/CD in CircleCI. Looks like there is no out-of-the-box redundancy for when the hub is down.
Mithra
Mithraabout 7 years ago
Hello can some one help me to Create a docker file with environment variables such as (production, QA ) in JSON.
Mithra
Mithraabout 7 years ago
For now I want to set up the Environment variables (Dev, Stage or Test and Production) in a single docker file instead of creating env variables for each environment. All I need is to get those environment variables in a single docker file and deploy through web application in azure portal. Please help me up on it.
Mithra
Mithraabout 7 years ago
So that the variables has to pick up Dynamically.
Matt Gowie
Matt Gowieabout 7 years ago
Hey folks — I have a Docker container running in EBS. It starts up fine, but then immediately exits. This happens locally too, but if I make the docker container run in interactive by passing -it then it stays up until I make any keypress on my terminal window. I don’t believe I can pass -it to EBS (or even if I could that I would want to). But what do I need to do to keep that Docker container running since it’s starting up without errors? It’s a Java Jetty Server and I am invoking the java process via a script — i.e. my ENTRYPOINT is ./start-backend.sh.

What am I missing?
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)about 7 years ago
if the process inside a docker container exits for any reason, the container exits
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)about 7 years ago
your server prob is incorrectly configured so it does not listen on a port, or it throws an error and exists
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)about 7 years ago
if the server is configured correctly and it listens on a port, then when you start the container locally and do port binding, you’d be able to access the web server in a browser on the local computer
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)about 7 years ago
without -it
Matt Gowie
Matt Gowieabout 7 years ago
Huh — The server does bind to a port. If I startup locally without -it it does the following:


Oct-21-2019 4:21:21.558 PM EDT [main] INFO  JettyServer:185 [] Starting server on 0.0.0.0:8080...
Oct-21-2019 4:21:21.878 PM EDT [main] INFO  JettyServer:190 [] Server started.
Oct-21-2019 4:21:21.949 PM EDT [Thread-9] INFO  JettyServer:202 [] Stopping server...
Oct-21-2019 4:21:21.986 PM EDT [Thread-9] INFO  App:94 [] Shutting down...
Oct-21-2019 4:21:22.576 PM EDT [Thread-9] DEBUG App:135 [] Shutdown complete.


With -it the Jetty Server continues to run and I can hit 8080 via my browser.
Matt Gowie
Matt Gowieabout 7 years ago(edited)
Didn’t find this before, but it seems some folks add && tail -f /dev/null to their entrypoint or server startup process to keep it running. That sucks though as now the container isn’t monitoring the actual server process.
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)about 7 years ago
something is wrong with the server config, it should not start and then stop right away
Matt Gowie
Matt Gowieabout 7 years ago
@Andriy Knysh (Cloud Posse) Hm, gotcha. I will try figuring that out.
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)about 7 years ago
(check if the port is not taken by other processes)
Matt Gowie
Matt Gowieabout 7 years ago
Will do. Thanks for the quick info @Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)
Andriy Knysh (Cloud Posse)about 7 years ago
also looks like the server is starting on the main thread, but stopped on another thread. Could be something about maven/jetty config to wait for the forked child process https://www.eclipse.org/jetty/documentation/current/jetty-maven-plugin.html
tamsky
tamskyabout 7 years ago
Docker Desktop now allows users to access the [OSX] host’s SSH agent inside containers. Fixes docker/for-mac#410
- https://docs.docker.com/docker-for-mac/edge-release-notes/
Mithra
Mithraabout 7 years ago
Hello How to pass ENV file in docker ?