Tag: linux

Redirecting command output in docker

I want to do some simple logging for my server which is a small Flask app running in a Docker container. Here is the Dockerfile # Dockerfile FROM dreen/flask MAINTAINER dreen WORKDIR /srv # Get source RUN mkdir -p /srv COPY perfektimprezy.tar.gz /srv/perfektimprezy.tar.gz RUN tar x -f perfektimprezy.tar.gz RUN rm perfektimprezy.tar.gz # Run server EXPOSE […]

HDP 2.5 Hortonworks ambari-admin-password-reset missing

I have downloaded the sandbox from hortonworks (Centos OS), then tried to follow the tutorial. It seems like the ambari-admin-password-reset command is not there and missing. I tried also to login with putty, the console asked me to change the password so I did. now it seems like the command is there, but I have […]

Docker compose of mutiple sub-website

I am using Docker compose to run nginx+php+mysql environment,OS is centos 7.2, question is about mutiple sub-website on one host: For example: There is one host,two projects will run on this host, named project-a and project-b, two different docker-compose.yml exsist in project-a and project-b. Question: When executing docker-compose up in project-a and project-b,does nginx+php+mysql environment […]

Docker not starting “ could not delete the default bridge network: network bridge has active endpoints””

Any ideas how to fix it? Error starting daemon: Error initializing network controller: could not delete the default bridge network: network bridge has active endpoints OS: Debian 8 Docker version: 1.9.0, build 76d6bc9 ifconfig output: eth0 Link encap:Ethernet HWaddr e0:3f:49:a0:9d:b4 inet addr: Bcast: Mask: inet6 addr: fe80::e23f:49ff:fea0:9db4/64 Scope:Link UP BROADCAST RUNNING MULTICAST MTU:1500 Metric:1 RX […]

How to atomically update a counter shared between Docker instances

I have a simple C++ service (API endpoint) that increases a counter every time the API is called. When the caller posts data to the counter has to be incremented by 1 and return the value of the counter to the caller. Things get more complicated when the service is getting dockerized. When two […]

Installing Docker on CentOS 6.6

I’m trying to install Docker on CentOS 6.6 64 bit version. When execute sudo yum install docker I get this Loaded plugins: fastestmirror, refresh-packagekit, security Setting up Install Process Loading mirror speeds from cached hostfile * base: mirrors.psychz.net * extras: centos-distro.cavecreek.net * updates: distro.ibiblio.org No package docker available. Error: Nothing to do

How to start docker container as server

I would like to run a docker container that hosts a simple web application, however I do not understand how to design/run the image as a server. For example: docker run -d -p 80:80 ubuntu:14.04 /bin/bash This will start and immediately shutdown the container. Instead we can start it interactively: docker run -i -p 80:80 […]

Capturing output of python script run inside a docker container

The aim here is to use a docker container as a secure sandbox to run untrusted python scripts in, but to do so from within python using the docker-py module, and be able to capture the output of that script. I’m running a python script foo.py inside a docker container (it’s set as the ENTRYPOINT […]

docker how can I get the list of dependent child images?

I’m trying to remove an image and I get: # docker rmi f50f9524513f Failed to remove image (f50f9524513f): Error response from daemon: conflict: unable to delete f50f9524513f (cannot be forced) – image has dependent child images This is the docker version: # docker version Client: Version: 1.10.3 API version: 1.22 Go version: go1.5.3 Git commit: […]

Determining if a process runs inside lxc/Docker

Is there any way to determine if a process (script) runs inside an lxc container (~ Docker runtime)? I know that some programs are able to detect whether they run inside a virtual machine, is something similar available for lxc/docker?

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