linux-containers

How to execute MySQL command from the host to container running MySQL server?

﹥>﹥吖頭↗ 提交于 2021-02-05 12:46:15
问题 I have followed the instruction in https://registry.hub.docker.com/_/mysql/ to pull an image and running a container in which it runs a MySQL server. The container is running in the background and I would like to run some commands. Which is the best way to connect to the container and execute this command from command line? Thanks. 回答1: You can connect to your mysql container and run your commands using: docker exec -it mysql bash -l (Where mysql is the name you gave the container) Keep in

libcontainer vs Docker vs OCF vs runc?

你说的曾经没有我的故事 提交于 2020-06-09 17:00:09
问题 I'm trying to understand the Docker world a little better, and can't quite seem to wrap my brain around the differences between these. I believe that OCF is an emerging container standard being endorsed by OpenContainers, and I believe that Docker is set to be the first reference implementation of that standard. But even then, I have concerns that the Google Gods don't seem to be providing answers for: What exactly is the OCF "standard"? Just a written document? A written API? A compiled C

What benefits does Docker Compose have over Docker Swarm and Docker Stack?

南楼画角 提交于 2020-01-23 04:56:47
问题 From what I read it seems that Docker-Compose is a tool to create multiple containers on a single host while Docker Swarm is a tool that can do the exact same thing but with more control and on multiple hosts with the help of Docker Stack. I went through the tutorial and also came across this thread: docker-compose.yml vs docker-stack.yml what difference? And I'm coming to the conclusion that there's no reason to ever use Docker-Compose when you can use Docker Swarm with Docker Stack. They

How do I assign a port mapping to an existing Docker container?

有些话、适合烂在心里 提交于 2020-01-18 04:32:53
问题 I'm not sure if I've misunderstood something here, but it seems like it's only possible to set port mappings by creating a new container from an image. Is there a way to assign a port mapping to an existing Docker container? 回答1: You can change the port mapping by directly editing the hostconfig.json file at /var/lib/docker/containers/[hash_of_the_container]/hostconfig.json You can determine the [hash_of_the_container] via the docker inspect <container_name> command and the value of the "Id"

How do I assign a port mapping to an existing Docker container?

烂漫一生 提交于 2020-01-18 04:32:08
问题 I'm not sure if I've misunderstood something here, but it seems like it's only possible to set port mappings by creating a new container from an image. Is there a way to assign a port mapping to an existing Docker container? 回答1: You can change the port mapping by directly editing the hostconfig.json file at /var/lib/docker/containers/[hash_of_the_container]/hostconfig.json You can determine the [hash_of_the_container] via the docker inspect <container_name> command and the value of the "Id"

How to SSH in to different containers in Multi Container Azure App Service

别说谁变了你拦得住时间么 提交于 2020-01-07 08:31:32
问题 I want to SSH to my containers created in an Azure App Service. These are Linux based containers and used Docker Compose to deploy these to Azure App Service. I have followed the article to enable SSH. For one of the container (Container A) I am able to SSH (exposed port 2222, 80 for this). But I would like to SSH to other containers (Container B) too. I have exposed another port 2223 for Container B and followed the same steps in that document. When I try to access them using the command ssh

How to SSH in to different containers in Multi Container Azure App Service

故事扮演 提交于 2020-01-07 08:31:03
问题 I want to SSH to my containers created in an Azure App Service. These are Linux based containers and used Docker Compose to deploy these to Azure App Service. I have followed the article to enable SSH. For one of the container (Container A) I am able to SSH (exposed port 2222, 80 for this). But I would like to SSH to other containers (Container B) too. I have exposed another port 2223 for Container B and followed the same steps in that document. When I try to access them using the command ssh

Docker mount a volume as root

╄→гoц情女王★ 提交于 2019-12-22 14:04:41
问题 The problem description I have a Docker image, which is being executed with volume mounting options a large number of times. It is built in a way so that the default user does not have root permissions. However I need to make sure that when I mount the volume it is being mounted as root and not as the current working user because of security concerns. (The current working non-root user must not be allowed to delete any files inside the mounted volume.) Example From the host machine: docker

How to edit a file dynamically in a running docker container

谁说胖子不能爱 提交于 2019-12-21 20:35:08
问题 Background I had build a npm server(sinopia) docker image(https://github.com/feuyeux/docker-atue/blob/master/docker-images/feuyeux_sinopia.md), and in the CMD line, it will run the start.sh every time when the container is generated. CMD ["/opt/sinopia/start.sh"] This shell will create a yaml file dynamically. sed -e 's/\#listen\: localhost/listen\: 0.0.0.0/' -e 's/allow_publish\: admin/allow_publish\: all/' /tmp/config.yaml > /opt/sinopia/config.yaml Question I wish I could edit this config