Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 3 years ago.
Improve this question
Docker daemon autostarts some services on my machine whenever it boots up. How do I manage the list of services to be started automatically by the docker daemon?
Running docker containers have a restart policy to them. This is given to it by when running them and can be seen in the container metadata You can check if your services have them by
docker inspect <container_name>
Docker currently has four restart policies:
no
on-failure
unless-stopped
always
You can choose to update it for a running service by :
docker update --restart=no <container_name>
Update the restart policy of containers with this command:
docker update --restart=no <containers>...
Related
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 12 months ago.
Improve this question
Does systemctl daemon-reload need to be executed using root/sudo? and does the same command apply to both Centos 7 and Ubuntu 18.04.3 LTS?
$ systemctl daemon-reload
==== AUTHENTICATING FOR org.freedesktop.systemd1.reload-daemon ====
Authentication is required to reload the systemd state.
Authenticating as: neo
Password:
Yeah, I'd say so.
Unless you are doing it in a container with root privileges, pretty sure you need to have root permissions for anything related to systemd services.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 1 year ago.
Improve this question
I want to set up some stuff when starting Kubernetes node worker. Specifically, I change systemd service configuration and apply it (systemctl daemon-reload), but from inside the container, I don't know how to configure systemd of node worker
Not sure what you actually want to do, but
Usually systemd is not installed inside containers
I don't know what you want to implement, but I pretty sure that run systemd daemon inside container is a bad idea
In most cases if you want to start long running background process, that will be better idea to run it in separate container and connect two containers.
If you need to do some action on container start before run main process, just override entrypoint, and prepend own command before main one (you may add it with & symbol to run in background, but it is a not smart solution)
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 2 years ago.
Improve this question
So i want to cyclically restart my docker container (once a week - let's say Sunday, 22:00)
Does anyone know how to call docker restart ID every Sunday?
You could set up a restart policy with the docker run command, and use the -d parameter which Docker recommends,
More information in the docker documentation,
https://docs.docker.com/config/containers/start-containers-automatically/
Update:
Create a cron job to restart the docker container on Sunday at 22:00.
The Docker restart policy should start the container again.
Create an anacron job inside the container, to launch your program after the Docker container starts again.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 7 years ago.
Improve this question
I have pulled the phishing frenzy image from repo using this command.
I used this command
docker pull b00stfr3ak/ubuntu-phishingfrenzy
The image is downloaded fine and works I checked using this command.
docker images
Now for running the image I am issuing this command
run -d -p 80:80 b00stfr3ak/ubuntu-phishingfrenzy
but nothing happens , I want to know how I can run a downloaded image from docker in windows and where it is stored as well ?
The command should be docker run, not run
And the image is stored in your /var/lib/docker/images folder, in the boot2docker VM.
Closed. This question does not meet Stack Overflow guidelines. It is not currently accepting answers.
This question does not appear to be about a specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic on another Stack Exchange site, you can leave a comment to explain where the question may be able to be answered.
Closed 8 years ago.
Improve this question
As the question says, is it possible, once a container is already running, to create a mount inside it as a volume or otherwise, and to make that available to another container instance?
Volumes that need to be mounted into other containers must be defined when you create the container image. i.e. in your docker file. Once a volume is defined in the image every time a container is created from the image the volume is created. You can then tell docker to mount the same volume into another container using the --volumes-from switch. You cannot attach or modify volumes while containers are running.
In fact even if you stop containers you cannot add volumes without deleting and recreating the container using the volumes-from switch. This seems very stringent but docker containers are meant to be stateless hence this should not be a problem if your containers are defined well.