linux-containers

How to optimize performance for a docker container?

孤人 提交于 2019-11-30 05:02:25
I tested redis container based on. https://index.docker.io/u/dockerfile/redis/ With same redis-benchmark, redis-server runs inside a container much slower, than run on hosted OS, the actual statistics shown below. ( The first benchmark is for a docker container ) So, is there a way to optimize the performance for a docker container? vagrant@precise64:/tmp$ redis-benchmark -p 49153 -q -n 100000 PING (inline): 5607.27 requests per second PING: 6721.79 requests per second MSET (10 keys): 6085.69 requests per second SET: 6288.91 requests per second GET: 6627.78 requests per second INCR: 6454.11

Start full container in Docker?

一世执手 提交于 2019-11-29 22:22:22
According to this github issue it should be possible to start a full container with Upstart, cron etc. with Docker 0.6 or later but how do I do that? I was expecting that docker run -t -i ubuntu /sbin/init would work just like lxc-start -n ubuntu /sbin/init and I would get a login screen, but instead it displays nothing. I also tried to access it using ssh, but no luck. I'm using the default ubuntu image from Docker index. docker run ubuntu /sbin/init appears to work flawlessly for me with 0.6.6. You won't get a login screen because Docker only manages the process. Instead, you can use docker

Docker container and memory consumption

核能气质少年 提交于 2019-11-29 19:42:37
Assume I am starting a big number of docker containers which are based on the same docker image. It means that each docker container is running the same application. It could be the case that the application is big enough and requires a lot of hard drive memory. How is docker dealing with it? Does all docker containers sharing the static part defined in the docker image? If not does it make sense to copy the application into some directory on the machine which is used to run docker containers and to mount this app directory for each docker container? Docker shares resources at kernel level.

Backup a running Docker container?

本小妞迷上赌 提交于 2019-11-29 19:36:04
Is it possible to backup a running Docker container? Is the export command suitable for doing that? JuliandotNut Posted by one friend in comments Hi Slava, sorry that your question was closed. For the record, Slava is talking about docker.io, a runtime for linux containers. Yes, docker export is a suitable approach. It will generate a tarball of your entire container filesystem state, and dump it on stdout. So docker export $CONTAINER_ID > $CONTAINER_ID-backup.tar will yield a usable tarball. You can re-import the tarball with docker import - slava/$CONTAINER_ID-backup < $CONTAINER_ID-backup

How to configure a Docker container to be reachable by container_ip:port from outside the host machine?

懵懂的女人 提交于 2019-11-29 18:33:32
问题 I have a host machine with multiple IP addresses assigned to one network interface. I'd like to configure Docker in order to have containers "responding" each one to a single IP of these IP addresses assigned to the host machine. Can this be done with libcontainer or do I have to use the LXC driver and run my containers with --lxc-conf="lxc.network..." ? Thanks in advance. UPDATE I want each container to be reachable from outside; with the default Docker configuration I can only expose a port

How to optimize performance for a docker container?

此生再无相见时 提交于 2019-11-29 02:47:52
问题 I tested redis container based on. https://index.docker.io/u/dockerfile/redis/ With same redis-benchmark, redis-server runs inside a container much slower, than run on hosted OS, the actual statistics shown below. ( The first benchmark is for a docker container ) So, is there a way to optimize the performance for a docker container? vagrant@precise64:/tmp$ redis-benchmark -p 49153 -q -n 100000 PING (inline): 5607.27 requests per second PING: 6721.79 requests per second MSET (10 keys): 6085.69

Start full container in Docker?

本小妞迷上赌 提交于 2019-11-28 19:54:11
问题 According to this github issue it should be possible to start a full container with Upstart, cron etc. with Docker 0.6 or later but how do I do that? I was expecting that docker run -t -i ubuntu /sbin/init would work just like lxc-start -n ubuntu /sbin/init and I would get a login screen, but instead it displays nothing. I also tried to access it using ssh, but no luck. I'm using the default ubuntu image from Docker index. 回答1: docker run ubuntu /sbin/init appears to work flawlessly for me

Updating PATH environment variable permanently in Docker container

扶醉桌前 提交于 2019-11-28 17:44:25
I tried adding to the PATH in the files ~/.profile and /etc/profile as follow. PATH = $PATH:/required/path However, it does not work. Then I tried with adding the line show, which did not work either. export PATH It did not work even after restarting the container and the host both. If you want to include a /new/path in the Dockerfile , adding the line: ENV PATH "$PATH:/new/path" in Dockerfile should work. Put in your Dockerfile a line ENV PATH xxx see an example in this Dockerfile https://gist.github.com/deepak/5933685 user859375 I got the answer for this question in irc chat. Given here for

How to use sudo inside a docker container?

风流意气都作罢 提交于 2019-11-28 14:59:55
Normally, docker containers are run using the user root . I'd like to use a different user, which is no problem using docker's USER directive. But this user should be able to use sudo inside the container. This command is missing. Here's a simple Dockerfile for this purpose: FROM ubuntu:12.04 RUN useradd docker && echo "docker:docker" | chpasswd RUN mkdir -p /home/docker && chown -R docker:docker /home/docker USER docker CMD /bin/bash Running this container, I get logged in with user 'docker'. When I try to use sudo, the command isn't found. So I tried to install the sudo package inside my

Dockerfile: Docker build can't download packages: centos->yum, debian/ubuntu->apt-get behind intranet

风格不统一 提交于 2019-11-28 04:31:13
PROBLEM: Any build, with a Dockerfile depending on centos, ubuntu or debian fails to build. ENVIRONMENT: I have a Mac OS X, running VMWare with a guest Ubuntu 14.04, running Docker: mdesales@ubuntu ~ $ sudo docker version Client version: 1.1.2 Client API version: 1.13 Go version (client): go1.2.1 Git commit (client): d84a070 Server version: 1.1.2 Server API version: 1.13 Go version (server): go1.2.1 Git commit (server): d84a070 BEHAVIOR: Using "docker build" fails to download packages. Here's an example of such Dockerfile: https://github.com/Krijger/docker-cookbooks/blob/master/jdk8-oracle