boot2docker

Store `docker run` command output in BASH variable

天涯浪子 提交于 2020-01-03 09:04:06
问题 I'm having an issue storing the output of docker run -it -d -p 43211:3000 --name appname -h hostname -v $PWD/local_dir:/root/remote_dir repo/imagename in a BASH varibale. I tried `backticks`, I also tried running it like the official docs say BASH_VAR=$(docker run ...) , I even tried storing the output in a file with docker run --...>$FILE_DESCRIPTOR , but no luck storing the error situation, the situation when the name is already used by another container, like so: $ FATA[0000] Error

What does the DOCKER_TLS_VERIFY and DOCKER_CERT_PATH variable do?

被刻印的时光 ゝ 提交于 2020-01-01 02:56:27
问题 I am new to Docker, using boot2docker on Windows 7. While I was trying to configure Docker build through spotify maven plugin, I was asked to set below env variables : DOCKER_HOST DOCKER_CERT_PATH DOCKER_TLS_VERIFY Configuration was successful but am not sure What does the DOCKER_TLS_VERIFY and DOCKER_CERT_PATH variables do ? 回答1: As mentioned in the README: By default, boot2docker runs docker with TLS enabled . It auto-generates certificates and stores them in /home/docker/.docker inside the

Docker - image operating system “windows” cannot be used on this platform

≡放荡痞女 提交于 2019-12-31 08:34:13
问题 I tried this on my Windows 10 machine: Dockerfile: From microsoft/nanoserver CMD ["echo", "Hello World"] PS C:\FSD\Docker\Trial1> docker build -t lea/leatest . Sending build context to Docker daemon 2.048kB Step 1/2 : FROM microsoft/nanoserver latest: Pulling from microsoft/nanoserver bce2fbc256ea: Pulling fs layer 58f68fa0ceda: Pulling fs layer image operating system "windows" cannot be used on this platform 回答1: Your Docker host is configured to run Linux containers inside of a VM. To run

How to clear the logs properly for a Docker container?

早过忘川 提交于 2019-12-31 08:04:29
问题 I use docker logs [container-name] to see the logs of a specific container. Is there an elegant way to clear these logs? 回答1: From this question there's a one-liner that you can run: echo "" > $(docker inspect --format='{{.LogPath}}' <container_name_or_id>) I'm not a big fan of modifying Docker's files directly with this, a truncate command, or log rotate, since each are external to docker. The external log deletion could happen while docker is writing json formatted data to the file,

Docker Error: CSS File in Mapped Volume Fails to Update

浪子不回头ぞ 提交于 2019-12-30 10:40:55
问题 System Setup: Docker Version 1.9.1, build a34a1d5 Oracle VirtualBox 4.3.34r104062 Image: https://hub.docker.com/r/rc42/flaskserver/ When I edit the CSS file in my flask server <link rel="stylesheet" href="{{ url_for('static', filename='styles/bootstrap.css') }}"> , the following things seem to happen: The changes do not show up when I reload the localhost test page. The changes do not show up when I remove/rerun the container. The changes do not show up when I stop/restart the container. At

Can we pass ENV variables through cmd line while building a docker image through dockerfile?

家住魔仙堡 提交于 2019-12-29 02:49:50
问题 I am working on a task that involves building a docker image with centOs as its base using a Dockerfile . One of the steps inside the dockerfile needs http_proxy and https_proxy ENV variables to be set in order to work behind the proxy. As this Dockerfile will be used by multiple teams having different proxies, I want to avoid having to edit the Dockerfile for each team. Instead I am looking for a solution which allows me to pass ENV variables at build time, e.g., sudo docker build -e http

Mount volume to Docker image on OSX

淺唱寂寞╮ 提交于 2019-12-28 16:04:31
问题 On a Mac, how do you mount a volume to a Docker container? On my linux box, this is easy. All I need to do is something like -v /src/webapp:/opt/webapp when running the container. But Mac is different since I have to run boot2docker to run a VM in VirtualBox. I've tried running boot2docker init boot2docker up boot2docker ssh # to poke around boot2docker stop VBoxManage sharedfolder add "boot2docker-vm" --name "Users" --hostpath /Users boot2docker up boot2docker ssh "sudo modprobe vboxsf" but

Mount volume to Docker image on OSX

别等时光非礼了梦想. 提交于 2019-12-28 16:04:18
问题 On a Mac, how do you mount a volume to a Docker container? On my linux box, this is easy. All I need to do is something like -v /src/webapp:/opt/webapp when running the container. But Mac is different since I have to run boot2docker to run a VM in VirtualBox. I've tried running boot2docker init boot2docker up boot2docker ssh # to poke around boot2docker stop VBoxManage sharedfolder add "boot2docker-vm" --name "Users" --hostpath /Users boot2docker up boot2docker ssh "sudo modprobe vboxsf" but

How to support input Chinese (UTF-8) in boot2docker(tiny core) /bin/sh (shell)

女生的网名这么多〃 提交于 2019-12-25 07:52:08
问题 How to support input Chinese (UTF-8) in boot2docker(tiny core) /bin/sh (shell) For support Chinese (UTF-8), I try: su - docker -c "tce-load -wi getlocale coreutils " sudo getlocale.sh ==> select en_US.UTF-8 ==> enter ==> this will generate mylocale.tce file su - docker -c "tce-load -i mylocale coreutils" Then relogin will Chinese filename is supported now But bin /bin/sh shell input Chinese has issue: 来源: https://stackoverflow.com/questions/36783538/how-to-support-input-chinese-utf-8-in

docker out of disk space

谁说我不能喝 提交于 2019-12-25 06:39:36
问题 I'm hainvg trouble with docker and volume size. I'm running docker-machine with three containers. The one giving me trouble is the MySQL container which has a data-only container for persistance. When I try to import a mysql file, mysql complains that the table is full, which really means that the disk is out of space. Looking at the system, I see the problem, but don't know how to correct it: _ _ ____ _ _ | |__ ___ ___ | |_|___ \ __| | ___ ___| | _____ _ __ | '_ \ / _ \ / _ \| __| __) / _` |