linux-containers

Backup a running Docker container?

旧巷老猫 提交于 2019-12-18 10:04:14
问题 Is it possible to backup a running Docker container? Is the export command suitable for doing that? 回答1: 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

Docker container and memory consumption

谁说我不能喝 提交于 2019-12-18 10:03:23
问题 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

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

南楼画角 提交于 2019-12-17 17:37:29
问题 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

How to use sudo inside a docker container?

空扰寡人 提交于 2019-12-17 17:17:49
问题 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'

Error creating ubuntu 16 container under arch

断了今生、忘了曾经 提交于 2019-12-13 02:49:35
问题 I am trying to install a Ubuntu container on Archlinux using LXC. I am following this guide:https://gist.github.com/manoj23/8a35849697945896cdaef77927c695a7 After I run this command: lxc-create --name=ubuntu-16 --template=ubuntu -- --release xenial --arch amd64 I get the following error: Bad template: ubuntu Error creating container ubuntu-16 Why is this happening? 回答1: It says in the error. Bad template. You can see that in the current version of lxc there is no ubuntu template. The gist is

Why do ping packets not reach a custom gateway in docker?

会有一股神秘感。 提交于 2019-12-11 11:47:13
问题 The Story I have the following virtual Docker network configuration: ...10.2 ...10.3 ...100.3 ...100.2 +------+ +-------+ +------+ | so_A +--so_net_a--+ so_AB +--so_net_b--+ so_B | +------+ ...10.0/24 +-------+ ..100.0/24 +------+ Build with the setup script in the end of the question. Here so_A , so_AB and so_B are Debian containers; so_net_a and so_net_b are Docker networks (a recently added feature). I want to make a router out of the middle container so_AB . For that I replace the default

Embed code in docker container or mount it as a volume?

与世无争的帅哥 提交于 2019-12-07 11:47:20
问题 I'm a recent user of docker and I am about to migrate from VM to containers in my production environment. But then, I suddenly realize that what works perfectly for my dev and qa environments is not ideal for production. On my dev and qa, I mount my versioned project folder into a python/php (name it) container and I consider this container as a "running service" for my code. This saves me from having huge containers as the container history doesnt change when I change my code (git commit or

Starting Xserver in Docker Ubuntu container

北慕城南 提交于 2019-12-07 11:33:34
问题 I have minimal Ubuntu installation in my container and I want to have Xserver running. I need XServer, because my app requires meshlabserver, which itself needs Xserver. I installed xserver-xorg and all other packages, but when I try to start X in container via /usr/bin/X :0 it says: Fatal server error: (EE) xf86OpenConsole: Cannot open /dev/tty0 (No such file or directory) What am I doing wrong? How do I start X server? UPDATE: related question: Host screen turns off when I start X server in

Docker mount a volume as root

久未见 提交于 2019-12-06 15:55:08
The problem description I have a Docker image, which is being executed with volume mounting options a large number of times. It is built in a way so that the default user does not have root permissions. However I need to make sure that when I mount the volume it is being mounted as root and not as the current working user because of security concerns. (The current working non-root user must not be allowed to delete any files inside the mounted volume.) Example From the host machine: docker run -it -v /path/to/mount:/container/mounting/path image-name Inside the container current-user@docker

Starting Xserver in Docker Ubuntu container

坚强是说给别人听的谎言 提交于 2019-12-05 16:33:57
I have minimal Ubuntu installation in my container and I want to have Xserver running. I need XServer, because my app requires meshlabserver, which itself needs Xserver. I installed xserver-xorg and all other packages, but when I try to start X in container via /usr/bin/X :0 it says: Fatal server error: (EE) xf86OpenConsole: Cannot open /dev/tty0 (No such file or directory) What am I doing wrong? How do I start X server? UPDATE: related question: Host screen turns off when I start X server in docker container In my case it works nicely when I start container in privileged mode: docker run -