Tag: docker

Why docker container exits immediately

I run a container in the background using docker run -d –name hadoop h_Service it exits quickly. But if I run in the foreground, it works fine. I checked logs using docker logs hadoop there was no error. Any ideas? DOCKERFILE FROM java_ubuntu_new RUN wget http://archive.cloudera.com/cdh4/one-click-install/precise/amd64/cdh4-repository_1.0_all.deb RUN dpkg -i cdh4-repository_1.0_all.deb RUN curl -s http://archive.cloudera.com/cdh4/ubuntu/precise/amd64/cdh/archive.key | […]

What’s the difference between RUN and CMD in a docker file and when should I use one or the other?

I’m confused about when should I use CMD vs RUN. For example, to execute bash/shell commands (i.e. ls -la) I would always use CMD or is there a situation where I would use RUN? Trying to understand the best practices about these two similar Dockerfile directives.

Permission denied on accessing host directory in docker

In short: I am trying to mount a host directory in Docker, but then I can not access it from within the container, even if the access permissions look good. The details: I am doing sudo docker run -i -v /data1/Downloads:/Downloads ubuntu bash and then ls -al It gives me: total 8892 drwxr-xr-x. 23 root […]

Access host database from a docker container

If I have a mysql database running on some host machine, and that host is also running a docker container: How would I access the mysql database from within the docker container that is running on the host?. For instance, is there a way to publish a hosts port to the container (the inverse of […]

docker unauthorized: authentication required – upon push with successful login

While pushing the docker image (after successful login) from my host I am getting “unauthorized: authentication required”. Details below. -bash-4.2# docker login –username=asamba –email=anand.sambamoorthy@gmail.com WARNING: login credentials saved in /root/.docker/config.json *Login Succeeded* -bash-4.2# -bash-4.2# docker push asamba/docker-whale Do you really want to push to public registry? [y/n]: y The push refers to a repository [docker.io/asamba/docker-whale] […]

Bash Script to execute Docker container operations and extract container IP Address

I am trying to write a Linux bash script that creates and runs docker containers that run a simple python web server, extract the container IP Address and make an HTTP Request to the server through a browser. There seem to be some mistakes in my script and I need help in editing it. I […]

Unable to install docker

I am trying to do hyperledger fabric(setting up the environment) and it required docker. I tried searching the internet of solving to install docker but it was to no avail. The following is the errors encountered when I tried to install dockers. At git bash(git) I tried to use sudo apt-get install docker-engine. But it […]

Docker daemon fails

I am using Ubuntu 14.04 on Dell Latitude E6430 and have installed docker.io package. Now whenever I restart my system, first docker command fails with message Cannot connect to the Docker daemon. Is ‘docker -d’ running on this host? Hence to fix this i run below command and daemon works like charm ps -ef |grep […]

docker network in bridge mode

I have planing to install docker but as we know default docker networking is in NAT mode so it has own IP on docker0 interface which is 172.17.42.x. I want to reconfigure networking in full bridge mode so all my container get IP address from my LAN Wireless Router I am following this article and […]

Docker will be the best open platform for developers and sysadmins to build, ship, and run distributed applications.