docker-container

Docker : How are intermediate containers formed

半世苍凉 提交于 2019-11-30 06:33:34
I would like to understand the execution steps involved in building Docker Images using Dockerfile. Couple of questions I have listed down below. Please help me in understanding the build process. Dockerfile content #from base image FROM ubuntu:14.04 #author name MAINTAINER RAGHU #commands to run in the container RUN echo "hello Raghu" RUN sleep 10 RUN echo "TASK COMPLETED" Command used to build the image: docker build -t raghavendar/hands-on:2.0 . Sending build context to Docker daemon 20.04 MB Step 1 : FROM ubuntu:14.04 ---> b1719e1db756 Step 2 : MAINTAINER RAGHU ---> Running in 532ed79e6d55

Docker - Container is not running

霸气de小男生 提交于 2019-11-29 20:33:31
I'm completely a newbie to docker. I tried to start a exited container like follows, I listed down all available containers using docker ps -a . It listed the following, I entered the following commands to start the container which is in the exited stage and enter into the terminal of that image. docker start 79b3fa70b51d docker exec -it 79b3fa70b51d \bin\sh It is throwing the following error. FATA[0000] Error response from daemon: Container 79b3fa70b51d is not running But when I start the container using docker start 79b3fa70b51d . It throws the container ID as output which is normal if it

docker-compose creating multiple instances for the same image

房东的猫 提交于 2019-11-28 18:32:30
I need to start multiple containers for the same image. If i create my compose file as shown below, it works fine. version: '2' services: app01: image: app app02: image: app app03: image: app app04: image: app app05: image: app Is there any easy way for me to mention the number of instances for the compose instead of copy and pasting multiple times? Updated answer (Oct 2017) As others mentioned, the docker API has changed. I'm updating my answer since it's the one most people will probably look at. docker-compose up -d --scale app=5 Unfortunately, we cannot specify this in a docker-compose.yml

Docker - Container is not running

泄露秘密 提交于 2019-11-28 16:24:35
问题 I'm completely a newbie to docker. I tried to start a exited container like follows, I listed down all available containers using docker ps -a . It listed the following, I entered the following commands to start the container which is in the exited stage and enter into the terminal of that image. docker start 79b3fa70b51d docker exec -it 79b3fa70b51d \bin\sh It is throwing the following error. FATA[0000] Error response from daemon: Container 79b3fa70b51d is not running But when I start the

docker on ubuntu 16.04 error when killing container

南楼画角 提交于 2019-11-27 20:24:30
问题 I can't kill or stop any docker container. I've allowed non-privileged users to run Docker commands. And docker run hello-world works fine. But I can't stop any other container. I got following: $ docker stop 59e3b815d1dc Error response from daemon: cannot stop container: 59e3b815d1dc: Cannot kill container 59e3b815d1dcf2d8c8bcd3dd641c3c033b83ac68ea2f0257a32a76468af7374c: unknown error after kill: docker-runc did not terminate sucessfully: container_linux.go:393: signaling init process caused

How to assign more memory to docker container

被刻印的时光 ゝ 提交于 2019-11-27 07:21:47
As the title reads, I'm trying to assign more memory to my container. I'm using an image from docker hub called "aallam/tomcat-mysql" in case that's relevant. When I start it normally without any special flags, there's a memory limit of 2GB (even though I read that memory is unbounded if not set) Here are my docker stats CONTAINER CPU % MEM USAGE / LIMIT MEM % NET I/O BLOCK I/O PIDS ba57d6c9e9d2 0.22% 145.6 MiB / 1.952 GiB 7.29% 508 B / 508 B 0 B / 6.91 MB 68 I tried setting memory explicitly like so but with same results docker run -d --memory=10g --memory-swap=-1 -e MYSQL_PASSWORD=password

What is the difference between a Docker image and a container?

我与影子孤独终老i 提交于 2019-11-26 16:50:27
When using Docker, we start with a base image. We boot it up, create changes and those changes are saved in layers forming another image. So eventually I have an image for my PostgreSQL instance and an image for my web application, changes to which keep on being persisted. So the question is: What is a container? Thomas Uhrig An instance of an image is called a container. You have an image, which is a set of layers as you describe. If you start this image, you have a running container of this image. You can have many running containers of the same image. You can see all your images with docker

What is the difference between a Docker image and a container?

时光毁灭记忆、已成空白 提交于 2019-11-26 04:28:51
问题 When using Docker, we start with a base image. We boot it up, create changes and those changes are saved in layers forming another image. So eventually I have an image for my PostgreSQL instance and an image for my web application, changes to which keep on being persisted. What is a container? 回答1: An instance of an image is called a container. You have an image, which is a set of layers as you describe. If you start this image, you have a running container of this image. You can have many

How do I get into a Docker container's shell?

限于喜欢 提交于 2019-11-26 02:26:01
问题 I\'m getting started working with Docker. I\'m using the WordPress base image and docker-compose. I\'m trying to ssh into one of the containers to inspect the files/directories that were created during the initial build. I tried to run docker-compose run containername ls -la , but that didn\'t do anything. Even if it did, I\'d rather have a console where I can traverse the directory structure, rather than run a single command. What is the right way to do this with Docker? 回答1: docker attach

How to access host port from docker container

穿精又带淫゛_ 提交于 2019-11-26 01:27:32
问题 I have a docker container running jenkins. As part of the build process, I need to access a web server that is run locally on the host machine. Is there a way the host web server (which can be configured to run on a port) can be exposed to the jenkins container? EDIT: I\'m running docker natively on a Linux machine. UPDATE: In addition to @larsks answer below, to get the IP address of the Host IP from the host machine, I do the following: ip addr show docker0 | grep -Po \'inet \\K[\\d.]+\'