Tag: docker

Docker inspect format retrieve port mapping

I’d like to retrieve the port mapped to a container using docker inspect, I found something like that: docker inspect –format=” {{ .NetworkSettings.Ports }} ” containerid Output: map[1234/tcp:[map[HostIp: HostPort:49159]] 3306/tcp:<nil> 4444/tcp:<nil> 4567/tcp:<nil> 4568/tcp:<nil>] But I’d like to have an output like this: 1234/tcp:49159 Is it possible ?

How to hot deploy Java EE applications in Docker containers

I’m looking for the possibility of hot deploying Java EE applications into Docker containers. The most interesting content I found is the possibility to share the tomcat directory between the host and the container via “volumes”. But it’s not a hot deployment yet. Reference: https://groups.google.com/forum/#!topic/docker-user/b_4NRn9sLBQ Any suggestions on how to reach it?

docker exec: rpc error: code = 2 desc = oci runtime error: exec failed

every time I try to do: $ docker exec I get the error message: rpc error: code = 2 desc = oci runtime error: exec failed: container_linux.go:247: starting container process caused “process_linux.go:83: executing setns process caused \”exit status 16\”” Session 1 (works like expected): $ docker images REPOSITORY TAG IMAGE ID CREATED SIZE alpine latest […]

How to launch an app via Docker on every Pull Request?

I run Jenkins and my app is dockerized, i.e. when I run the container it exposes port 3000 and I can point my browser there. On every Github PR I would like to deploy that git commit to a running container somewhere and have Jenkins post back to the PR the link where it can […]

How to add tags to docker images made using autobuild

I’ve searched around and can’t find a real answer to this. If I create a docker git repo and set up autobuild to my dockerhub account, it will build with a single tag (i.e. latest, or 1.0 or foo) but I can’t find any way to add a tag afterwards as you can via command […]

Why does pushing a Docker image fail with “dial tcp: lookup cdn-registry-1.docker.io on read udp i/o timeout”?

I’m pushing to a private docker repository on Docker Hub and I keep getting this error: 2726b5968341: Image successfully pushed 2fd0731064ec: Image successfully pushed 49328a658a81: Image successfully pushed 6beafaa9c78d: Image successfully pushed bb8b822852f4: Image successfully pushed 6a0d258340b1: Pushing FATA[0457] Failed to upload metadata: Put https://cdn-registry-1.docker.io/v1/images/6a0d258340b180fd569ec687653d805ebb70e77c1943ca6cfc9d296392ad79ee/json: dial tcp: lookup cdn-registry-1.docker.io on read udp i/o […]

Control lifetime of .NET Core console application hosted in docker

Disclaimer – this is almost the same question as docker container exits immediately even with Console.ReadLine() in a .net core console application – but I don’t think accepted answer on this question is satisfactory. What I am trying to achieve I am building a console application (it is a HTTP service using ServiceStack) which is […]

Docker.io init.d script not working on start container

I’ve a container with odoo on it on the dir “/opt/odoo/”. A init script on “/etc/init.d/odoo-server” #!/bin/bash ### BEGIN INIT INFO # Provides: odoo # Required-Start: $remote_fs $syslog # Required-Stop: $remote_fs $syslog # Default-Start: 2 3 4 5 # Default-Stop: 0 1 6 # Short-Description: Start openerp daemon at boot time # Description: Enable service […]

Docker Copy and change owner

Given the following Dockerfile FROM ubuntu RUN groupadd mygroup RUN useradd -ms /bin/bash -G mygroup john MKDIR /data COPY test/ /data/test data RUN chown -R john:mygroup /data CMD /bin/bash In my test directory, which is copied I have set the file permissions to 770. If I do a su john inside my container, I cannot […]

Automatically mounting host folders other than c:\Users in Docker images in Windows

I’ve got a program that needs to automatically install & manage some Docker containers on Windows with minimal user input. It needs to automatically setup Docker to mount arbitrary Windows folders. It needs to do this from a clean install, where the Docker VM cannot be assumed to have been created. Docker by default will […]

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