Prompt stringlengths 14 160 | Instruction stringlengths 18 2k | Response stringlengths 8 2k |
|---|---|---|
How do I see a list of all minikube clusters running in Docker on my mac? | I run a Kubernetes cluster on my mac using the latest Docker community edition. I usually do:$ minikube start --vm-driver=hyperkitand it works well for me.Today, I ran that command multiple times in a script. Now, how do I know how many minikube VMs are running on a mac? How do I delete all but one of them? Can I see ... | You are using theHyperkitminikube driver that uses the/usr/local/bin/hyperkitcommand line (in reality it uses thexhyveHypervisor). So a simple:$ ps -Af | grep hyperkit
0 9445 1 0 1:07PM ttys002 1:45.27 /usr/local/bin/hyperkit -A -u -F /Users/youruser/.minikube/machines/minikube/hyperkit.pid -c 2 -m 2048... |
How can I run a docker container and commit the changes once a script completes? | I want to set up a cron job to run a set of commands inside a docker container and then commit the changes to the docker image. I'm able to run the container as a daemon and get the container ID using this command:CONTAINER_ID=$(sudo docker run -d my-image /bin/sh -c "sleep 10")but I'm having trouble with the second pa... | Run it in the foreground, not as daemon. When it ends the script that launched it takes control and commits/push it |
In Nginx docker how do we see log only from error.log | Nginx Docker file is configured to send error.log to /dev/stderr.RUN ln -sf /dev/stdout /var/log/nginx/access.log
&& ln -sf /dev/stderr /var/log/nginx/error.logWhen we rundocker logs --tail=10 -f nginxit show a combination of both error log and access log. Is there a docker command so I can only see the logs of er... | Try this command to get only error.log:docker logs -f nginx 1>/dev/nullAnd this one for access.log:docker logs -f nginx 2>/dev/null |
Passing arguments for Dockerfiles using Docker compose | I'm trying to use parametrize my dockerfiles on build phase and use arguments in Docker-compose. For example in Docker compose I have defined one service called bpp as following:bpp:
build:
context: .
dockerfile: Dockerfile.bpp
args:
gp : 8080
image: serv/bpp
restart: always
depends_on:
- ... | You need to addARG gpto your Dockerfile....
ARG gp
EXPOSE $gp
...https://docs.docker.com/engine/reference/builder/#argWorth mentioning that this isn't going to expose the port when you're running it via compose though, you would need to add aportsinstruction to your docker-compose.yml for that. |
Docker compose ignores my Dockerfile when I use the build command | I have this folder structure:/home/me/composetest
/home/me/composetest/mywildflyimageInside composites I have this docker-compose.yml:web:
image: test/mywildfly
container_name: wildfly
ports:
- "8080:8080"
- "9990:9990"Inside mywildflyimage I have this docker image:FROM jboss/wildfly
EXPOSE... | rundocker-compose buildafter changing docker-comopse.yml and thendocker-compose up |
docker can not write on mounted volume with non-root user | I have Dockerfile with myuser from nginx image and I want to mount logs on mounted location, I am using docker-compose to start the container. My requirement is to use non-root user only and no sudo.My dockerfile with myuser, image tag I create is mynginx:v1RUN addgroup mygroup
RUN adduser myuser --disabled-password
US... | Most propably the UID on your host formyuserdoes not match the UID formyuserinside the Container.SolutionIf you want to write from within your container into a directory of your host machine you must first create amyuserUser on your host and check its UID via$ sudo su - myuser -c "id"
uid=1000(myuser) gid=100(users) Gr... |
How do I avoid 'port collision' when using docker? | I hope the title is descriptive enough. I am trying to execute my node app (that uses mongo and mysql) in docker. I am usingdocker-composeto start the app anddocker-compose.ymlfile below:version: "3.3"
services:
app:
container_name: app
restart: always
build: .
volumes:
- ./:/app
ports:
... | In your docker-compose.yml file you are exposing ports from your pods on your hosts' network space by declaring them in theportsarray, such as:ports:
- "3306:3306"If you omit this part of the configuration, your containers will still be able to reach each other privately, but the ports won't be bound in your host mac... |
How to bind the published port to specific eth[x] in docker swarm mode | I'm trying to deploy my container to docker swarm cluster(docker engine 1.12.1).The features ofdocker swarm modereally are exciting, such as clustering docker, multi-host networking.However I find something can't be archived in swarm mode so far(docker 1.12.x), which works well when usingdocker runto start container.My... | Unfortunately, it seems like this is currentlynot supported. |
When building Jenkins in Docker plugins fail to install | I have a Dockerfile for a custom Jenkins master like so:FROM jenkins
MAINTAINER me
USER root
RUN echo 2.0 > /usr/share/jenkins/ref/jenkins.install.UpgradeWizard.state
RUN apt-get update \
&& apt-get install -y sudo \
&& apt-get install -y vim \
&& rm -rf /var/lib/apt/lists/*
RUN echo "jenkins ALL=N... | Your Dockerfile works for me, installs all plugins and builds the image successfully:Analyzing war...
Downloading plugins...
Downloading plugin: git from https://updates.jenkins.io/download/plugins/git/2.6.0/git.hpi
> git depends on workflow-scm-step:1.14.2,mailer:1.17,matrix-project:1.7.1,ssh-credentials:1.12,parame... |
REST request from one docker container to another fails | I have two applications, one of which has a RESTful interface that is used by the other. Both are running on the same machine.Application A runs in a docker container. I am running it using the command line:docker run -p 40000:8080 --name AppA image1When I test Application B outside a docker container (in other words, ... | Simply linking B to Adocker run -p 8081:8081 --link AppA --name AppB image2, then you can access the REST service usingAppA:8080.The reason is that Docker containers run on its own subnet (normally 172.17.0.0-255) and they cannot access the network that your host is on. Alsolocalhostwould be the container itself, not t... |
How to pass through environment variables in docker run through an env file? | Given this Dockerfile:FROM alpine:3.7
ENV LAST_UPDATED=2018-02-22
ARG XDG_CACHE_HOME=/tmp/cache/
RUN apk update && \
apk add libxslt && \
apk add sed && \
apk add py-pip && \
apk add mariadb-client && \
apk add bash bash-doc bash-completion && \
pip install httpie && \
rm -rf /var/cache/apk/... | Keep in mind that thedocker runargument order is mandatory:$ docker help run
Usage: docker run [OPTIONS] IMAGE [COMMAND] [ARG...]The environment setting fall under options:-e, --env list Set environment variables
--env-file list Read in a file of environmentHence:docker run... |
Add SSL Certificate to Windows Docker Container | How can I add a.cer-Certificate inside a Docker container? It has to be done via powershell since the container has no interface to openmms.exe.Thisis a good tutorial for.pfx-Certificates. Since I have a.cer-file without private key, I have to adapt it slightly.
The powershell command from thedocumentationImport-Certif... | The problem does not appear when importing to the LocalMachine folder:Import-Certificate -FilePath C:\myCertificateToAdd.cert -CertStoreLocation Cert:\LocalMachine\Root\Like this, the certificate is importet to every "CurrentUser" on the machine. If this is ok, as for the typical DockerContainer, the problem is solved. |
Docker: I can't map ports other than 80 to my WordPress container | I want to map some random port on my computer e.g.localhost:7006to my WordPress docker container'sport 80.When I change the port of WordPress from80:80to7006:80it's not only stops working onlocalhost(port 80)but also don't respond onlocalhost:7006.docker-compose.ymlfile looks like this:version: '3'
services:
... | After a bit of research I found out that the WordPress container sets it's ports once since it needs to save the URLs(localhost:7006) in the db because I am persisting the db data.I ran thedocker-compose uponce with the default port80:80configuration which caused thelocalhost:80orlocalhostto be saved in the db. So when... |
VSCode Remote Container - Error: ENOSPC: No space left on device | I have been using theVSCode Remote Container Pluginfor some time without issue. But today when I tried to open my project the remote container failed to open with the following error:Command failed: docker exec -w /home/vscode/.vscode-server/bin/9833dd88 24d0faab /bin/sh -c echo 34503 >.devport
rejected promise not han... | Trydocker system prune --allif you don't see any container or images withdocker psanddocker images, but be careful it removes all cache and unused containers, images and network.docker ps -aanddocker images -ashows you all the containers and images including ones that are currently not running or not in use.Check the d... |
How much memory and cpu nginx and nodejs in each container needs? | I want to create a task definition in aws ecs.How much memory and cpu I need to run nginx in conatiner? and nodejs in another container?nginx - just a proxy from 80 to 3000.nodejs - simple services that call to atlas mongodb | I will never recommend a hard memory limit while running container in ECS.Plus you can not determine memory for the idle state of the container so better to have look on some benchmark for Nginx while node memory vary from application to the application also poor code might consume more memory than good and managed app... |
terminationGracePeriodSeconds not | I have a .NET Core console application running in a docker container that I am deploying through Kubernetes.
When I update the deployment image, I would like to keep the existing pod around for a while, without accepting new connections, but to keep existing connections alive for a period to allow existing users to fin... | The way the grace period works is that the main docker process is immediately sent a SIGTERM signal, and then it is allowed a certain amount of time to exit on its own before it is more forcefully shutdown. If your app is quitting right away, it is because it quits when it gets this signal.Your app could catch the SIGT... |
Correct way to start docker daemon listening to specific port | I´m new to docker and want to start it in daemon mode listening to a specific IP-adress and port. In thedocumentationit is said that this can be done by writingsudo /usr/bin/docker daemon -H 0.0.0.0:5555. It then says that I can list running containers with this commanddocker ps. If I try this I get the following messa... | I found a solution to my problem. I specified docker running on IP x and Port y, but docker then only listens to that socket. I had to add another -H flag with the unix socket in order to listen to local requests:sudo /usr/bin/docker daemon -H tcp://0.0.0.0:5555 -H unix:///var/run/docker.sock |
symfony docker permission problems for cache files | I have a symfony setup for docker with docker-compose which is working well except when i runcache:clearfrom console, the webserver cant access the files.I can circumvent the permission problem by uncommentingumask(0000);in console and web/app_dev.php but i would like to run symfony as recommended.What i do is spin up ... | I'd think changingwww-datas userid to your host-user's id is a good solution, as permissions for the host user are fairly easy to setup.#change www-data`s UID inside a Dockerfile
RUN usermod -u [USERID] www-datauser id 1000 is the default for most linux systems afaik... 501 on macyou can runid -uon the host system to f... |
Passing a command with arguments as a string to docker run | The issue I'm facing is how to pass a command with arguments todocker run. The problem is thatdocker rundoes not take command plus arguments as a single string. They need to be provided as individual first-class arguments todocker run, such as:#!/bin/bash
docker run --rm -it myImage bash -c "(cd build && make)"However ... | Start with the syntax of thedocker runcommand, which is:docker run [OPTIONS] IMAGE[:TAG|@DIGEST] [COMMAND] [ARG...]This means if you run:DOCKER_COMMAND='bash -c "(cd build && make)"'
docker run --rm -it myImage "$DOCKER_COMMAND"You are passing the entirety of the$DOCKER_COMMANDvariable as theCOMMAND. You are asking Do... |
Error: Postgres database import in docker container | I'm running a ruby on rails application in docker container. I want to create and then restore the database dump in postgres container.
But I'mBelow is what I've done so far:1)Added bash script in/docker-entrypoint-initdb.dfolder. Script is just to create database:psql -U docker -d postgres -c 'create database dbname;'... | I got it working by adding acontainer_namefor db container. Mydbcontainer have different name (app_name_db_1) and I was connecting to a container nameddb.After giving the hard-codedcontainer_name(db), it gets working. |
Docker container published ports not accessible? | So here is the situation, I have a container running built with this dockerfile:FROM python:2-onbuild
EXPOSE 8888
CMD [ "nohup", "mock-server", "--dir=/usr/src/app", "&" ]I run it with this command:docker build -t mock_server .
docker run -d -p 8888:8888 --name mocky mock_serverI am using it on a mac so boot2docker is... | First guess is the python program is explicitly binding to the loopback IP address127.0.0.1which disallows any remote connections. Check the docs for that python mock tornado server for something like--bind=0.0.0.0and adjust accordingly.You can confirm if this is the case by doing a docker exec and in the container run... |
OpenShift V3 vs. OpenShift V2 [closed] | Closed. This question needs to be morefocused. It is not currently accepting answers.Want to improve this question?Update the question so it focuses on one problem only byediting this post.Closed8 years ago.Improve this questionI'm searching for a main difference between OpenShift V3 and V2.
Is OpenShift V2 working lik... | This is a rather broadly asked question, so I will (and can) answer only in a rather broad manner.There are a lot of key concepts that have changed. These are the most important ones and you'll need some time to get into it, but they are a big improvement to OpenShift v2.:Cartridges vs. Docker ContainersGears vs. Kuber... |
Save a file generated by app running on docker to a given path in the host machine | I have a python app running on a docker container and it generates a pdf file. I want to store the generated pdf file in a given path in the host machine.I am not sure on how can this be achieved. Any ideas? | Mount a volume in your container mapped to the desired path in your hostdocker run -d -v /host/path:/python_app/output your_docker_imageWhere/python_app/outputis the path inside the container where your app is writing the pdf file.Note that/host/pathshould have enough permissionschmod 777 /host/path |
How to use docker ENTRYPOINT with shell script file combine parameter | I write shell script file and use this with docker ENTRYPOINT
but when I run docker image, it just stops without any error log because of entrypoint code linemy DockerfileFROM ubuntu:16.04
MAINTAINER limtaegeun <[email protected]>
RUN apt-get update
RUN apt-get install -y nginx
RUN echo "\ndaemon off;" >> /etc/nginx/n... | When a Docker container is run, it runs theENTRYPOINT(only), passing theCMDas command-line parameters, and when theENTRYPOINTcompletes the container exits. In the Dockerfile theENTRYPOINThas to be JSON-array syntax for it to be able to see theCMDarguments, and the script itself needs to actually run theCMD, typically ... |
Why is pg_restore segfaulting in Docker? | I am testing a backup/restore procedure for my postgres DB inside a docker container.I dump my db like this:$ docker exec -ti my_postgres_container pg_dump -Fc -U postgres > db.dumpAfterwards, I try to restore it like this:$ docker cp db.dump my_postgres_container:/db.dump
$ docker exec -ti my_postgres_container pg_res... | TLDR:-tshould not be used unnecessarily.I think for your pg_dump, the-tis corrupting the data written to db.dump. For that matter, the-iis also redundant since pg_dump does not need to read from stdin.For your pg_restore, you need neither option. If you redirect stdin from outside the container, then you need-i.I had t... |
How to clean docker devicemapper folder properly ? | I have some problem about the storage. The folder/var/lib/docker/devicemapper/is taking 50% of my storage.In the folder/var/lib/docker/devicemapper/mnt, I have many empty folders.How can I properly clean dockerdevicemapperand remove all unused mapping ? | With recent versions of Docker you can see the space used with:docker system dfand prune it with:docker system pruneThe above command combines theprunecommand that exists for volumes, containers, images and networks:docker volume prunedocker container prunedocker image prunedocker network pruneEach command has a--helpo... |
Why can't I copy my .git folder into my docker container | We have got a node.js/typescript project and now I am supposed to provide data to our sonarqube analysis.We are using a docker container to run our tests in and after the tests are finished, we are running the sonarqube analysis so we can use the code coverage report from the tests for it.The only problem is, that the ... | You copied the contents of the .git folder into the /dist directory, not the .git folder itself. If you want to copy the folder, specify the target as the folder you want to create:COPY .git/ ./.git/ |
How to allow a range of ports in Kubernetes in containerPort variable? | In docker, I can expose a range of ports using "-p 65000-65050:65000-65050". How do I achieve this for kubernetes in a pod.yml or replication-controller.yml? | You can't. From the v1 API specs:"ports": [
{
"name": "string",
"hostPort": 0,
"containerPort": 0,
"protocol": "string",
"hostIP": "string"
}
]Each port is uniquely identified and exposing host ports would be an anti-pattern in Kubernetes. |
Run Jupyter Notebook in the Background on Docker | I am trying to run a jupyter notebook in the background without printing anything to the console. I found this solution in aquestionfor bash:jupyter notebook &> /dev/null &But I am running jupyter in a docker container and want it to start in the background viaCMD. How can I do the same in sh? | I got it to work using the setup from:https://github.com/jupyter/docker-stacks/tree/master/minimal-notebookthe trick was to install tini and put the following code into a start-notebook.sh script:#!/bin/bash
exec jupyter notebook &> /dev/null &this is than added to the path with:COPY start-notebook.sh /usr/local/bin/an... |
Writing to docker volume from Dockerfile does not work | Please consider the following Dockerfile:FROM phusion/baseimage
VOLUME ["/data"]
RUN touch /data/HELLO
RUN ls -ls /dataProblem: "/data" directory does not contain "HELLO" file. Moreover, any other attempts to write to volume directory (via echo, mv, cp, ...) are unsuccessful - the directory is always empty. No error me... | Each step of the Dockerfile is run in it's own container that is discarded when that step is done, and volumes are discarded when the last (in this case only) container that uses them is deleted after it's command finishes.This makes volumes poorly suited to use in Dockerfilesbecause they loose their contents half way ... |
docker-swarm vs.docker-compose on single host in production | Is there a reason to usedocker-swarminstead ofdocker-composefor deploying a single host in production?I'm currently rewriting an existing application. My predecessors set up the application using docker-swarm. But I do not understand why: the application will only consist of a single host running a couple of services. ... | Docker Swarm and Docker Compose are fundamentally different animals. Compose is a build tool that lets you define and configure a group of related containers, whereas swarm is an orchestration tool that manages multiple docker engines in a way that lets you treat them (somewhat) as a single unit. Swarm exposes an API t... |
Rust actix_web inside docker isn't attainable, why? | I'm trying to make a docker container of my rust programme, let's lookDockerfileFROM debian
RUN apt-get update && \
apt-get -y upgrade && \
apt-get -y install git curl g++ build-essential
RUN curl https://sh.rustup.rs -sSf | bash -s -- -y
WORKDIR /usr/src/app
RUN git clone https://github.com/unegare/rust-ac... | If you're like myself and followed the examples on the Actix website, you might have written something like this, or some variation thereof:fn main() {
HttpServer::new(|| {
App::new()
.route("/", web::get().to(index))
.route("/again", web::get().to(index2))
})
.bind("127.0.0.... |
Docker: Error response from daemon: remove myvol: volume is in use | When I'm trying to remove a volume I get this error:Error response from daemon: remove myvol: volume is in use -
[2a177cb40a405db9f245fccd776dcdeacc d266ad624daf7cff510c9a1a1716fe]But bothdocker psanddocker container lsreturn an empty list.I've tried restarting the docker daemon.I use Docker Toolbox on Windows 10. | try to delete all stopped containers:docker rm -f $(docker ps -a -q)then delete the volumeyou can see stopped container usingdocker ps -ausingdocker pswill return only running containersEDIT since you are on Windowslist stopped containers:docker ps -adelete the stopped container - you need to replace CONTAINER_ID with ... |
Access to outside of context in Dockerfile | In my Maven project I have following structure:docker/
docker-compose.yml
A/
Dockerfile
B/
Dockerfile
src/
target/
foo.warIn A's Dockerfile I need access to war in/targetfolder with the following command:COPY ../../target/foo.war /usr/local/tomcat/webapps/foo.warwhen I rundocker-compose uptt gives... | As far as I know it's not possible to access things outside out your build context.You might have some luck by mixing thedockerfiledirective with thecontextdirective in your compose file in the root dir of your project as follows:build:
context: .
dockerfile: A/DockerfileYou may wish to include a.dockerignorein th... |
docker login behind proxy on private registry gives TLS handshake timeout | We have a private docker registry at work (based on portus, but whatever) and I try to push an image to this registry but it doesn't work. It fails with the following error message:$ sudo docker login archive.docker-registry.mycompany.com
Username: mylogin
Password:
Error response from daemon: Get https://archive.dock... | actually, I found that if I comment out the full Environment line it works for the private registry but not for docker hub anymore (of course, no more proxy). And here is the final solution that works for both private registry and docker hub public registry:In the NO_PROXY environment variable, only the domain name sho... |
Is supervisord needed for docker+gunicorn+nginx? | I'm running django with gunicorn inside docker, my entry point for docker is:CMD ["gunicorn", "myapp.wsgi"]Assuming there is already a process that run the docker when the system starts and restart the docker container when it stops, do I even need to use supervisord? if gunicorn will crash won't it crash the docker an... | The only time you need something like supervisord (or other process supervisor) in a Docker container is if you need to start up multiple independent processes inside the container when the it starts.For example, if you needed to startbothnginx and gunicorn in the same container, you would need to investigate some sort... |
how to remote access to mariadb on docker? | I've created a docker container containing an instance of mariadb, but i cannot access to the database from my phisical machine:I've got the ip address from docker inspect and the port from docker ps but Sequel Pro gave me the connection failed message (same thing with Visual Studio Code). Obviously from inside the doc... | It's worked for me:Create a new mariadb containerdocker container run \
--name sql-maria \
-e MYSQL_ROOT_PASSWORD=12345 \
-e MYSQL_USER=username \
-e MYSQL_PASSWORD=12345 \
-e MYSQL_DATABASE=dbname \
-p 3306:3306 \
-d mariadb:10Watch the logs and wait for mariadb ... |
Symfony server:run in php Docker container | I have a php docker container where is my symfony project.Here is mydocker-compose.ymlphp-fpm:
build: ./php
container_name: php-fpm
links:
- db
ports:
- 9000:9000
- 8448:8448
- 8000:8000
working_dir: /var/www/html/
volumes:
- ../app:/var/www/html
volum... | Following @Alex Blex answer: It works when you run it on all interfaces.php bin/console server:run 0.0.0.0:8000 |
not able to perform gcloud init inside dockerfile | I have made a Dockerfile for deploying my node.js application into google container engine .It looks like as belowFROM node:0.12
COPY google-cloud-sdk /google-cloud-sdk
RUN /google-cloud-sdk/bin/gcloud init
COPY bpe /bpe
CMD cd /bpe;npm startI should use gcloud init inside Dockerfile because my node.js application is u... | gcloud initis a wrapper command which runsgcloud config configurations create MY_CONFIG
gcloud config configurations activate MY_CONFIG
gcloud auth login
gcloud config set project MY_PROJECTwhich allows user to choose configuration, login (via browser) and choose a project.For your use case you probably do not want to ... |
How to set the shared drives in Docker for Windows? | How to set the shared drives in Docker for Windows? I am using the latest version 18. Stable and Edge. My settings screen is shown below. It's missing some options like Shared Drives, Advanced and Network, which are shown in the second image. Why am I missing these options?My settings:Screen from a website: | Seems you are Running Docker for Windows using "Windows Containers". If you switch to "Linux containers" you'll see "Shared Drives" option.Take a look this video.According Docker documentation:shared drives for Windows containers is not implemented.Volume mounting requires shared drives for Linux containers (not for
Wi... |
How happens when Linux distributions are different between the docker host and the docker image? | As I understand, a Docker image (and consequently, a container) can be instantiated from different Linux distributions, such as Ubuntu, CentOS and others.Let's say my Docker host is running standard Ubuntu 14.04.What happens if I use container that is not based on the same Linux distribution?Not 14.04?Not Ubuntu (or an... | Docker doesnotuse LXC (notsince Docker 0.9) but libcontainer (nowrunc), a built-in execution driver which manipulates namespaces, control groups, capabilities, apparmor profiles, network interfaces and firewalling rules – all in a consistent and predictable way, and without depending on LXC or any other userland packag... |
standard_init_linux.go:190: exec user process caused "exec format error" when running Go binary | I am attempting to create a container with my Go binary in for use as a database migrator. If I run the binary it works perfectly, however, I am struggling to put it into a container and run it in my docker-compose stack.Below is my Dockerfile.FROM golang:1.11 AS build_base
WORKDIR /app
ENV GO111MODULE=on
# We want t... | I had the same error message. For me the fix was to cross build the for the right architecture. In my case amd64. Like this:RUN CGO_ENABLED=0 GOOS=linux GOARCH=amd64 go build -a -installsuffix cgo -o [OUTPUT] . |
Setting context in docker-compose file for a parent folder | I got a docker-compose file in which I want to set a context and docker file to look something like this:build:
context:
dockerfile: For now my file is in the root folder so its simply:build:
context: .
dockerfile: .This way it does work.The structure of the project is something like this:./
- folder1/
... | You've set:dockerfile: .Just try to use a relative path to you Dockerfile from the set context:context: ../../
dockerfile: ./folder1/folder2/Dockerfile |
Docker container doesn't start after reboot with enabling systemd script | I have the following systemd script:[Unit]
Description=Hub docker container
After=docker.service
[Service]
User=root
ExecStart=/home/hub/hub.sh
ExecStop=/bin/docker stop hub
ExecStopPost=/bin/docker rm hub
[Install]
WantedBy=multi-user.targetRunning the command:systemctl start/stop hubworks fine. I also created the s... | In order to start container after reboot you need to add this property:--restart=alwaysto your container start script. For example:docker run -d -p 80:5000 --restart=always image_name |
How to Force Docker to release storage space after manual delete of file in volumes and containers? | I have few issues with storage spaces. I deleted few big files such as log files (after find unix of big files).The problem is that delete manually some file of Docker (in /var/lib/docker/...). After deletion of Docker files, I can see that the space left does not change. Docker does not release space.I restart the ser... | Docker cleanup job is rather non-existing and you are basically in charge of doing it yourself. There are ways of doing that as pointed out inthis blog-post, yet I rather use third-party scripts, e.g.:docker-cleanto clean up some of the mess docker leaves behind. |
Docker Java Application failing at obtaining input from console | I am trying to create a docker image for my java application. At startup this application needs to be given a password (currently via console).I tried several methods of obtaining input however they have all failed. Is this a limitation of docker and if so is there a workaround?For this snippet:Console console = System... | Solved it.By running the command using the -i and -t parameters you can be allowed to enter the password. using all 3 methods.so basicallydocker run -i -t |
docker-compose restart interval | I have adocker-compose.ymlfile with a following:services:
kafka_listener:
build: .
command: bundle exec ./kafka foreground
restart: always
# other servicesThen I start containers with:docker-compose up -dOn my amazon instance kafka-server (for example) fails to start sometimes, so./kafka foregoundscript... | You can use this policy :on-failureTheon-failurepolicy is a bit interesting as it allows you to tell Docker to restart a container if the exit code indicates error but not if the exit code indicates success. You can also specify a maximum number of times Docker will automatically restart the container. likeon-failure:3... |
How to run .NET unit tests in a docker container | I have a .NET Core application containing MSTest unit tests. What would the command be to execute all tests using this Dockerfile?FROM microsoft/dotnet:1.1-runtime
ARG source
COPY . .
ENTRYPOINT ["dotnet", "test", "Unittests.csproj"]Folder structure is:/Dockerfile
/Unittests.csproj
/tests/*.cs | Use a base image with .NET Core SDK installed. For example:microsoft/dotnet
microsoft/dotnet:1.1.2-sdkYou can't rundotnet testin a Runtime-based image without SDK. This is why an SDK-based image is required. Here is a fully-workableDockerfileexample:FROM microsoft/dotnet
WORKDIR /app
COPY . .
RUN dotnet restore
# ru... |
Docker exec printf gives No such file or directory error | I am trying to run the following command for an existing docker container:docker exec my_docker printf '%sTest' >> /usr/local/src/test.txtIt gives me the following error:-bash: /usr/local/src/test.txt: No such file or directoryWhile when I do the following:docker exec -it my_docker bashAnd type the same command, everyt... | There is a good reason for this: it's being interpreted as two commands. Try wrapping the printf command in a command string:docker exec my_docker bash -c 'printf "%sTest" >> /usr/local/src/test.txt'The key is that you've used a bash operator. Similar to any time you run something like:echo one two >> file.txtThe ">>" ... |
Install / Configure SQL Server PDO driver for PHP docker image | I have a simple docker file, as follows:FROM php:7.2-apache
COPY src/ /var/www/html/Normally to install drivers for Mongo or MySQL connectivity I would do so by adding something like the below to the dockerfile:docker-php-ext-install mongoOn this occasion I want to connect my php application to a SQL Server database, a... | I have created a docker file for this exact purpose:FROM php:7.3-apache
ENV ACCEPT_EULA=Y
RUN apt-get update && apt-get install -y gnupg2
RUN curl https://packages.microsoft.com/keys/microsoft.asc | apt-key add -
RUN curl https://packages.microsoft.com/config/ubuntu/20.04/prod.list > /etc/apt/sources.list.d/mssql-rele... |
Connection Refused from Request Inside Docker Compose | I have an API running on my host machine on port 8000. Meanwhile, I have a docker compose cluster with one container that's supposed to connect said API. To get the url for the request, I use "host.docker.internal:8000" on my windows machine and it works wonderfully. However, I have a linux deployment server and in the... | Credit to @Hans Kilian:Addextra_hoststo docker-compose fileChange URL to usehost.docker.internalinstead oflocalhostChange service to serve on0.0.0.0instead oflocalhost |
mtune and march when compiling in a docker image | When compiling in a docker image (i.e. in the dockerfile), what shouldmarchandmtunebe set to?Note this is not about compiling in a running container, but compiling when the container is being built (e.g. building tools from source when the image is run).For example, currently when I rundocker buildand install R package... | If I usenativein an image built by Dockerhub, I guess this will use the spec of the machine used by Dockerhub, and this will impact the image binary available for download?That's true. When the docker image is built, it is done on the host machine and using its resources, so-march=nativeand-mtune=nativewill take the sp... |
Apple M1 to Linux x86_64: unrecognized command-line option '-m64' | I am trying to generate an image for my Rust service from a Mac M1 Silicon to be run on my x86_64 box in a Kubernetes cluster.This is my Dockerfile:FROM rust:latest AS builder
RUN rustup target add x86_64-unknown-linux-musl
RUN apt update && apt install -y musl-tools musl-dev
RUN apt-get install -y build-essential
RUN... | I thinkcargois using a wrong linker due not detecting that it is a cross-compilation.Try to addENV RUSTFLAGS='-C linker=x86_64-linux-gnu-gcc'to your Dockerfile:FROM rust:latest AS builder
RUN rustup target add x86_64-unknown-linux-musl
RUN apt update && apt install -y musl-tools musl-dev
RUN apt-get install -y build-e... |
How to use the ARG instruction of Dockerfile for Windows image | I would like to pass an argument in my dockerfile to build my docker image. I've seen in other post and docker manual how to do this but it doesn't work in my case.
Here is an extract of my code where i use my argument:ARG FirefoxVersion
RUN powershell -Command iex ((new-object net.webclient).DownloadString('https://c... | (This answer is the formalized version of mycomment.)Try to use%FirefoxVersion%ARG FirefoxVersion
RUN powershell -Command iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'));
RUN choco install -y firefox --version %FirefoxVersion% --ignore-checksumsReason:The error message"The command ... |
What is equivalent remote api command to 'docker run -d'? | I'm trying to call docker commands via remote api.Docker remote api does not seem to have 'Detached mode' option.http://docs.docker.io/en/latest/commandline/command/run/I could use this app in the bash, and I would like to use this via remote api.https://github.com/grigio/docker-stringer | Indeed, the remote API does not have a 'detach' mode as the 'attach' mode is an extra endpoint.If you want to run in detach mode with the remote API, simply create and start your container without attaching to it.If the container still shuts down immediately, usedocker logs to check for errors. The problem might have n... |
Serving multiple tensorflow models using docker | Having seenthisgithub issue andthisstackoverflow post I had hoped this would simply work.It seems as though passing in the environment variableMODEL_CONFIG_FILEhas no affect. I am running this throughdocker-composebut I get the same issue usingdocker-run.The error:I tensorflow_serving/model_servers/server.cc:82] Buildi... | There is no docker environment variable named “MODEL_CONFIG_FILE” (that’s a tensorflow/serving variable, see docker imagelink), so the docker image will only use the default docker environment variables ("MODEL_NAME=model" and "MODEL_BASE_PATH=/models"), and run the model “/models/model” at startup of the docker image.... |
Docker with make: build image on Dockerfile change | I playing with Docker and make utility and try to write rule which rebuilds docker image only on Dockerfile change.My project structure looks like:tree .
.
├── Dockerfile
├── Makefile
└── project
└── 1.jsMy Dockerfile is pretty simple:FROM ubuntu
RUN apt-get update
RUN apt-get install -y curl
RUN curl -sL https:/... | When you write:run: build
docker run -v $(CURDIR)/project:/project app-serverin a makefile make expects that that recipe will create a file by the name ofrun. make will then check that file's timestamp against the timestamp of its prerequisite files to determine if the recipe needs to be run the next time.Simil... |
docker-compose: publish multiple ports | I'm trying to publish 2 ports of a simple docker container to make some tests.Here are the steps to reproduce the issue.My simple Dockerfile:FROM bash:4
RUN echo okBuilt usingdocker build . -t essaiMy first version for the docker-compose.yml file, this one works:version: '3'
services:
essai:
image: essai
po... | According to thedocker documentation, the recommended way to specify port mapping is string declaration specially when a container port lower than 60. |
Docker Compose Make Shared Volume Writable Permission Denied | I have this image that writes into the /temp/config and I wanted to map those data into a shared volume in my hostdocker-compose downversion: '2'
services:
service-test:
image: service-test:latest
container_name: service-test
volumes:
- source_data:/temp/config/
volumes:
source_data:When my se... | I believe your container is running as some specific user other than root.In your docker-compose.yml you can add user: rootSeedocker-compose-reference |
run chroot within docker | I've a commercial app, that is shipped in a chroot environment : the startup script is making the chroot, and starting the exe.The App is pretty complex, and also for support purposes, I don't want to change the all environment.Is it possible to run chroot, and start the service in docker ? Or are the two incompatible ... | It is possible to make a chroot inside a container... but, as mentioned in "debootstrap inside a docker container", you might need torun with the privileged mode.docker run --privilegedBy default, Docker containers are “unprivileged” and cannot, for example, run a Docker daemon inside a Docker container.This is because... |
standard_init_linux.go:211: exec user process caused "no such file or directory"? | DockerfileFROM python:3.7.4-alpine
ENV PYTHONUNBUFFERED 1
ENV PYTHONDONTWRITEBYTECODE 1
ENV LANG C.UTF-8
MAINTAINER "[email protected]"
RUN apk update && apk add postgresql-dev gcc musl-dev
RUN apk --update add build-base jpeg-dev zlib-dev
RUN pip install --upgrade setuptools pip
RUN mkdir /code
WORKDIR /code
COPY... | The "shebang" line at the start of a script says what interpreter to use to run it. In your case, your script has specified#!/bin/bash, but Alpine-based Docker images don't typically include GNU bash; instead, they have a more minimal/bin/shthat includes just the functionality in the POSIX shell specification.Your scr... |
Have sshd forward logins of git user to a (GitLab) Docker container | I would like to configure sshd on my host machine to forward public key logins of a certain user to a Docker container that runs its own sshd service.To give some context, I have GitLab running in a Docker container and I dislike opening another port on the host machine for the SSH GitLab communication but instead have... | I found a simple workaround to this. Just create a Git user on the host machine and provide a proxy script that executes the given Git commands in the GitLab container using the host's SSH daemon and the.ssh/authorized_keysfrom the container volume.On the host machine, add the usergitusing the same UID & GID as in the ... |
Is it possible to convert the publish method of an App Service from Code to Docker? | I have set up an Azure App Service (Linux) publish method being Code and have set up the appropriate pipeline to build and deploy my code (nodejs).
Now I need more control on the host running my code (need poppler). On dev + test I have created new App Services and have chosen Docker Container as publish methodMy quest... | I turned my code-based app into a container by looking at some commands from this guide;https://learn.microsoft.com/en-us/azure/app-service/tutorial-custom-container?pivots=container-linuxThe important steps:Login and select subscription etcEnable Identity and assign AcrPull role so the App Service
can fetch the imageT... |
How to run flask_migrate in Docker | I have a project with the following structure:proj
src
application
app.py
manage.py
migrations
Dockerfile
docker-compose.yamlMy goal is to run migrations from the application directory to create tables in the database during docker-compose.python manage.py db upgradeDockerfileFROM python:3.7... | I'd add a bash script that has the commands you want to run during startup and use that as the default entry point in your image. It's usually best practice to call this scriptentrypoint.sh#!/usr/bin/env bash
python manage.py db upgrade
flask run --host=0.0.0.0And then, in your Dockerfile, replace the last line with th... |
Docker port mapping is not working on windows 10 | I am new to docker. I am trying to get a simple node app running on docker. However I am facing an issue with the docker port publish.Docker version- 18.03.0-ce, build 0520e24302My simple app code:'use strict';
const express = require('express');
// Constants
const PORT = 8081;
const HOST = '0.0.0.0';
// App
const a... | On Windows, Linux containers are created inside a virtual machine that runs on Windows host OS. This virtual machine gets assigned an IP. While doing the curl, you should use this IP instead oflocalhost. Here,localhostmeans the Windows host and not the virtual machine that we intend to hit on the port 8080.To know the ... |
Jupyter starting a kernel in a docker container? | I want to switch my notebook easily between different kernels. One use case is to quickly test a piece of code in tensorflow 2, 2.2, 2.3, and there are many similar use cases. However I prefer to define my environments as dockers these days, rather than as different (conda) environments.Now I know that you can start ju... | Full disclosure: I'm the author of Dockernel.By usingDockernelPut the following in a file calledDockerfile, in a separate directory.FROM python:3.7-slim-buster
RUN pip install --upgrade pip ipython ipykernel
CMD python -m ipykernel_launcher -f $DOCKERNEL_CONNECTION_FILEThen issue the following commands:docker build --... |
How to pip install in a docker image with a jenkins pipline step? | I have thisDockerfile:FROM python:3.7
CMD ["/bin/bash"]and thisJenkinsfile:pipeline {
agent {
dockerfile {
filename 'Dockerfile'
}
}
stages {
stage('Install') {
steps {
sh 'pip install --upgrade pip'
}
}
}This causes the following error:The directory '/.cache/pip/htt... | As I mentionedin this comment, the solution should be adding a proper user inside the container. Jenkins uses984:984for uid/gid on my machine (but may be different on yours - login to the host Jenkins is running on and executesudo -u jenkins id -ato detect them), so you need to replicate it in the container that should... |
How to programmatically monitor if a docker container exited? | I am running multiple named docker containers (200+) on my VM Host.
I have a manager script/code that is supposed to manage the containers from the host.
I would like to know if there is any event-based mechanism to get notified when a container stops/fails. So that I can restart the stopped container.One solution I co... | Look atdocker events- there is an event for container 'die'.There is also an http interface to get the same information programmatically - seehereYou may want to do a web search for 'docker orchestration' - many projects springing up to manage multiple containers in the way you describe. |
Installing Docker on CentOS 6 after removal of docker-io | For some time, thedocker-iopackage has been used to install Docker on CentOS 6.Since early this month, this package no longer appears to be available:[[email protected]:0 yum.repos.d]# yum install docker-io
Loaded plugins: fastestmirror, presto
Setting up Install Process
Determining fastest mirrors
* base: mirror.inte... | I'm not sure whydocker-iosuddenly disappeared, but the same version previously available through the epel repository can be installed directly from this rpm hosted by Docker:[root@server]# yum install
https://get.docker.com/rpm/1.7.1/centos-6/RPMS/x86_64/docker-engine-1.7.1-1.el6.x86_64.rpm
[root@server]# docker --ver... |
Nginx HTTP not redirecting to HTTPS 400 Bad Request "The plain HTTP request was sent to HTTPS port" | I'm running nginx in docker. HTTPS works fine but when I explicitly make HTTP request I get the following error400 Bad Request
The plain HTTP request was sent to HTTPS portnginx.conf is as followsworker_processes auto ;
events {}
http {
include /etc/nginx/mime.types;
access_log /var/log/nginx/main.access.l... | Put the following directive to the server block where you listen for port 443.error_page 497 https://$host:$server_port$request_uri;This directive implies that when "The plain HTTP request was sent to HTTPS port" happens, redirect it to https version of current hostname, port and URI.Kinda hacky but works. |
How to start the cloudwatch agent in container? | From the docker hub there is animagewhich is maintained by amazon.Any one knowhow to configure and start the containeras I cannot find any documentation | I got this working! I was having the same issue with you when you seeReading json config file path: /opt/aws/amazon-cloudwatch-agent/bin/default_linux_config.json ... Cannot access /etc/cwagentconfig: lstat /etc/cwagentconfig: no such file or directoryValid Json input schema.What you need to do is put your config file ... |
How can I make docker-machine create a VM in a specific location | My development machine is a laptop with a smallish SSD and a huge external disk. Ideally I'd like docker-machine to use the external drive rather than filling up my internal disk.I know that I can hack it with mounts and so on but is there a way to make the docker-machine command use a directory that I specify instead ... | Have you tried this option-s, --storage-path"Configures storage path [$MACHINE_STORAGE_PATH]"?You can see it in docker-machine --help. |
Docker image versioning and lifecycle management | I am getting into Docker and am trying to better understand how it works out there in the "real world".It occurs to me that, in practice:You need a way to version Docker imagesYou need a way to tell the Docker engine (running on a VM) to stop/start/restart a particular containerYou need a way to tell the Docker engine ... | docker has all you need to build images and run containers. You can create your own image by writing a Dockerfile or by pulling it from the docker hub.In the Dockerfile you specify another image as the basis for your image, run command install things. Images can have tags, for example the ubuntu image can have the late... |
Mounting nginx conf as a docker volume causes system error boot2docker | I'm trying to run nginx within a docker container whilst mounting the configuration and static html files for it to serve up. Very simple stuff as far as I'm aware, but I keep getting an error about the directory not being a directory?I'm running this example on my Mac using the latest version of Boot2Docker.I have the... | -v /Users/M/Projects/Docker/nginx-example/nginx.conf:/etc/nginx:royou are attempting to mount a file to a directory - change that to:-v /Users/M/Projects/Docker/nginx-example/nginx.conf:/etc/nginx/nginx.conf:roand you should be fine. Take a look at the examples in theDocker Volumes DocsAs well,pwdshould work in the pat... |
How do I run Katalon test suite in Jenkins inside Docker | I have a Katalon test suite setup and it runs great in the UI and from the CLI on the machine where I have Katalon studio installed.I have Jenkins CI server running in a docker container, and I would like to setup a job to run my test suite on that Jenkins server.What runtime do I need on the Jenkins server so it can r... | EDIT- New answer from Katalon supportI got a new response from Katalon support that says:First of all, I would to sorry for my answer due to I'm not giving out the proper one based on your question. I've reviewed again your question and see Katalon Studio have Linux version (http://download.katalon.com/4.8.0/Katalon_St... |
Communicating between different docker services in docker-compose | I just started working with docker-compose and am currently struggling with communication between the different services.I have 2 services,aliceandbob. I want these to be able to send http requests to each other. As far as I understood, services should be able to reach each other by using the servicename as hostname.Un... | As clearly documented inNetworking in ComposeNetworked service-to-service communication use the CONTAINER_PORTThus you should use the container ports to communicate between the containers.http://bob:5000andhttp://alice:5000. |
Connection between docker containers via UNIX sockets | I’m newbie to Docker, but i’d like to know: is it possible to connect one container from another container on Linux machine (any) with UNIX sockets?
For example i have one container for application core and second containers which covers database things.
Second example is two containers with application code, and first... | Yes. You can mount a socket into a container using a volume mount. And multiple containers can mount the same volume, whether that's a named volume or a host mount, to share the socket between the containers. You see this frequently with containers that mount the docker socket today, e.g.docker run -it --rm -v /var/run... |
aws cdk push image to ecr | I am trying to do something that seems fairly logical and straight forward.I am using the AWS CDK to provision an ecr repo:repository = ecr.Repository(
self,
id="Repo",
repository_name=ecr_repo_name,
removal_policy=core.RemovalPolicy.DESTROY
)I then have a Dockerfile which lives at the root of my proj... | AWS CDK depricated therepositoryNameproperty onDockerImageAsset. There are a few issues on GitHub referencing the problem. Seethis commentfrom one of the developers:At the moment the CDK comes with 2 asset systems:The legacy one (currently still the default), where you get to specify a repositoryName per asset, and the... |
How to execute commands in docker container as part of bash shell script | I would like to write a bash script that automates the following:Get inside running containerdocker exec -it CONTAINER_NAME /bin/bashExecute some commands:cat /dev/null > /usr/local/tomcat/logs/app.log
exitThe problematic part is whendocker execis executed. The new shell is created, but the other commands are not execu... | You can useheredocwithdocker execcommand:docker exec -i CONTAINER_NAME bash <<'EOF'
cat /dev/null > /usr/local/tomcat/logs/app.log
exit
EOFTo use variables:logname='/usr/local/tomcat/logs/app.log'then use as:docker exec -i CONTAINER_NAME bash < "$logname"
exit
EOF |
How to configure docker to be able to have internet access via wireless connection? | I am trying to build a docker image by using the ones in the repository however i haven't been able to run 'apt-get update' 'apt-get install' commands because it seems that the container is not connected to the internet. I think the problem is caused by the fact that i am using a wireless connection. Is there a way to ... | I see two possibility:1) Make sure your ip_forward is set to 1 (sysctl -w net.ipv4.ip_forward=1)2) Make sure it is not a DNS issue: trydocker run base ping google.com, if it does not work, you can set custom dns server:docker run -dns 8.8.8.8 base ping google.com. |
Docker Compose how to extend service with build to use an image instead | Having a basedocker-compose.ymllike the following:version: '2'
services:
web:
build: .
...How can I extend it to use an image instead?docker-compose.prod.ymlversion: '2'
services:
web:
image: username/repo:tagRunning it with dockerdocker-compose -f docker-compose.yml -f docker-compose.prod.yml upstill promp... | Omit thebuildon the basedocker-compose.yml, and place it in adocker-compose.override.ymlfile.When you run docker-compose up it reads the overrides automatically.Extracted from theDocker Compose Documentation.Since yourdocker-compose.ymlfile must have either build or image, we'll use image that has less priority, result... |
How to get into CoreDNS pod kuberrnetes? | I have a running k8s cluster with two replicas of CoreDNS. But when i try enter the bash prompt of the POD it's throwing me below error# kubectl exec -it coredns-5644d7b6d9-285bj -n kube-system sh
error: Internal error occurred: error executing command in container: failed to exec in container: failed to start exec "94... | You can use the sidecar pattern following the instructions here:https://support.rancher.com/hc/en-us/articles/360041568712-How-to-troubleshoot-using-the-namespace-of-a-container#sidecar-container-0-2In short, do this to find a node where a coredns pod is running:kubectl -n kube-system get po -o wide | grep corednsssh t... |
Eclipse - Docker integration | I'm looking for a way to integrate Docker containers with the Eclipse platform.
I would like to run all build/test/debug command inside containers and use same containers in Continuous Integration build and later in production.The simplest way I looked on, was just to configure custom command but besides permissions pr... | it is not a full answer to your question but we (JBoss Tools team) started working on this and here are a few blogs about what is possible todo today and where we are with Eclipse docker tooling.http://tools.jboss.org/blog/2015-03-02-getting-started-with-docker-and-wildfly.htmlhttp://tools.jboss.org/blog/2015-03-03-doc... |
Why doesn't Docker support multi-tenancy? | I watchedthis YouTube video on Dockerand at 22:00 the speaker (a Docker product manager) says:"You're probably thinking 'Docker does not support multi-tenancy'...and you are right!"But never is any explanation of why actually given. So I'm wondering: what did he mean by that?Why Docker doesn't support multi-tenancy?!If... | One of the key features most assume with a multi-tenancy tool is isolation between each of the tenants. They should not be able to see or administer each others containers and/or data.The docker-ce engine is a sysadmin level tool out of the box. Anyone that can start containers with arbitrary options has root access on... |
How to access mysql outside my kubernetes cluster? | I am running a kubernetes cluster in my centos machine.
I donot want to create a pod for mysql. MySQL is installed in another machine in same network (Machine is not in kubernates private network).How can I access the mysql service from the pods running in kubernetes cluster ?I have tried with service and end point wi... | You don't need a service for things outside the cluster. Depending on the networking model you're using, the docker container (ie kubernetes pod) should be able to connect to the MySQL container normally via the bridge that Docker sets up. Check the host has connectivity on port 3306, and it does, simply put in the DNS... |
docker macvlan - no route to host (container) | Im trying to understand the "macvlan" network from docker. I create a new network:docker network create -d macvlan \
--subnet=192.168.2.0/24 \
--gateway=192.168.2.1 \
-o parent=eno1 \
pub_netAnd start new container with the new network:docker run --rm -d --net=pub_net --ip=192.168.2.74 --name=whoami -t jwilder/... | I believe it is by design that host cannot reach its own containers through a macvlan network. I leave it to others to explain why exactly this is so, but to verify that this is where your problem lies, you can try to ping your container at192.168.2.74from another host on the network or even from another container or v... |
How to run a shell and docker executor on the same unix host? | I would like to use the same host computer to execute Docker builds using the shell executor, as described in the link below, and normal builds using the docker executor.I would like to be able to start builds of both types on the same host.I would like to use the debian package provided for Ubuntu and installed via an... | Rungitlab-runner registermultiple times. It will always append new configurations to the same/etc/gitlab-runner/config.tomlfile. |
how to expose 2375 from Docker desktop for windows | I'm new to Docker. My Docker Desktop for Windows version is 19.03.5.
I want to expose port 2375 from Docker desktop for windows, but if I use the GUI setting,that only can be accessed via tcp://127.0.0.1, My inner IP address 192.168.3.9 doesn't work.https://learn.microsoft.com/en-us/virtualization/windowscontainers/man... | Docker doesn't run native on Windows. It actually creates a Linux VM where it runs the docker daemon. You can see this VM with VirtualBox (assuming you like many others use VirtualBox for virtualization).For this reason, in order to get your setup you need to modify this VM. You need to make sure its network interface ... |
Cannot connect Robomongo using MongoDB docker image | I am running mongo docker image that I pulled fromdocker hub mongo imageIt works ok but when I start Robomongo I cannot connect to localhost. With following error message:Cannot connect to the MongoDB at localhost:27017.Error:
Network is unreachableI appreciate any help, thanks.EDIT: I solved the issue by using the fol... | Don't forget to map port to host port:docker run --name some-mongo -p 27017:27017 -d mongoThendocker-machine ipgives me192.168.99.100Type in terminalmongo 192.168.99.100printsMongoDB shell version: 3.2.4
connecting to: 192.168.99.100/test
Server has startup warnings:
2016-08-22T07:35:20.214+0000 I CONTROL [initandlis... |
WARNING: no logs are available with the 'none' log driver | I am following below url for logging driverhttps://docs.docker.com/engine/admin/logging/overview/#configure-the-default-logging-drivernow, I want to remove this logging driverI have remove file(daemon.json) from /etc/docker folder too.But when I build container, system should always showing me warningWARNING: no logs a... | Finally solved.1) Deletedaemon.jsonfile from/etc/dockerfolder.2) Restart docker service. |
What Docker base image (`FROM`) for Java Spring Boot? | What Docker base image (FROM) for Java Spring Boot application?I am just starting with docker, and I see thatFROMinsideDockerfilecan define image for Java likeFROM java:8If I am building using Gradle (or Maven) is the better base image to start to avoid configuring later what is common for Gradle/Maven project?And of c... | There's a nice documentation on how to integrate Spring-Boot with Docker:https://spring.io/guides/gs/spring-boot-docker/Basically you define your dockerfile insrc/main/docker/Dockerfileand configure the docker-maven-plugin like this:
com.spotify
docker-maven-plugin
0.4.11
${docker.image.prefix}/${project.artifactId}... |
Unable to access my minikube cluster from the browser (❗ Because you are using a Docker driver on windows, the terminal needs to be open to run it.) | I am trying to access a simple minikube cluster from the browser, but I keep getting the following:❗ Because you are using a Docker driver on windows, the terminal needs to be open to run it.I've created an external service for the cluster with the port number of 30384, and I'm running minikube in a docker container.I... | I got the same issue resolved it by changing minikube base driver to hyperv from docker.Enable-WindowsOptionalFeature -Online -FeatureName Microsoft-Hyper-V -AllYour pc will restart after that you can sayminikube config set driver hypervThenminikube startwill start you with that driver.This worked for me. |
How to run 2 wordpress blogs using docker on ec2 | I just started playing around with Docker.io. Its a great platform for sure. I have an issue i need some help with. I ran a medium instance on ec2 setup docker. Now i want to run 2 wordpress blog independent of each other using docker.io on top of the medium instance.Please if someone can kindly guide me to resolve thi... | Hareem asked his question a while back, and there don't seem to be any good answers yet. I'm a noobie as well, and I too want to learn how to use a generic wordpress container that I can push to Amazon or test locally. I'm very new to docker, so this seems like a tall order!GoalFor now, I'll start collecting some resou... |
I2C inside a docker container | I am trying to use the i2c pins on a raspberry pi inside a docker container. I install all my modules using RUN but when I use the CMD to run my python program i get an error that saysTrackback (most recent call last):
file "test.py", line 124, in
bus = smbus.SMBus(1)
IOError: [Errno 2] No such file or directoryIf I r... | As a security precaution, system devices are not exposed by default inside Docker containers. You can exposespecificdevices to your container using the--deviceoption todocker run, as in:docker run --device /dev/i2c-0 --device /dev/i2c-1 myimageYou can remove all restrictions with the--privilegedflag:docker run --privi... |
Attaching process to Docker libcontainer container | In Docker releases previous to v0.9.0, you could attach(inject) a process into a container by using lxc-attach. For example:docker run -d ubuntu:12.04
docker inspect {{containerhash}} | grep ID
// "ID": "d846ae242838de66f12414fbc8807acb3c77778bdb81babab7115261f4242284"
sudo lxc-attach -n d846ae242838de66f12414fbc8807ac... | Check if you have thensentertool. It should be in theutil-linuxpackage, after version 2.23. Note: unfortunately, Debian and Ubuntu still ship with util-linux 2.20.If you havensenter, it's relatively easy. First, find the PID of the first process of the container (actually, any PID will do, but this is just easier and s... |
error MSB3073: The command "npm install" exited with code 1 | i was containerizing my .Net + React.js application but during the process I have encountered an unexpected error. I got myself acquainted with similar posts but none of the solutions solved my problem. Since the build log is quite long I have placed in pastebin:https://pastebin.com/PhfYW3zmThe dockerfile which I am us... | Deleting thenpm installtags from .csproj as suggested in this threadhttps://github.com/dotnet/sdk/issues/9593by user PKLeso resolved the problem.This will delete frontend from your container completely if I remember correctly. However if you want to remain it within container just make sure thatnpm installon your front... |
Docker - is it safe to switch to non-root user in ENTRYPOINT? | Is it considered a secure practice to run root privilegedENTRYPOINT ["/bin/sh", entrypoint.sh"], that later switches to non-root user before running the application?More context:There are a number of articles (1,2,3) suggesting that running the container as non-root user is a best practice in terms of security. This ca... | I just looked through what relevant literature (Adrian Mouat'sDocker, Liz Rice'sContainer Security) has to say on the topic and added my own thoughts to it:The main intention behind the much cited best practice to run containers as non-root is to avoid container breakouts via vulnerabilities in the application code. Na... |
Go server empty response in Docker container | I have a Go server which something like that. Router is Gorilla MUXvar port string
if port = os.Getenv("PORT"); port == "" {
port = "3000"
}
srv := &http.Server{
Handler: router,
Addr: "localhost:" + port,
WriteTimeout: 15 * time.Second,
ReadTimeout: 15 * time.Second,
}
fmt.Println("Se... | Don't uselocalhost(basically an alias to127.0.0.1) as your server address within a Docker container. If you do this only 'localhost' (i.e. any service within the Docker container's network) can reach it.Drop the hostname to ensure it can be accessed outside the container:// Addr: "localhost:" + port, // unreach... |
Invalid mount config for type "bind": bind mount source path does not exist: /home/jenkins/.docker (Istio) | I try to buildistio(1.6.0+) using Jenkins and get an error:docker: Error response from daemon: invalid mount config for type "bind":
bind mount source path does not exist: /home/jenkins/.dockertheslavecontains.dockerdirectory:13:34:42 + ls -a /home/jenkins
13:34:42 .
13:34:42 ..
13:34:42 agent
13:34:42 .bash_logout
13:... | As I mentioned in comments, workaround here could be to use-vinstead of--mountDifferences between -v and --mount behaviorBecause the -v and --volume flags have been a part of Docker for a long time, their behavior cannot be changed. This means that there is one behavior that is different between -v and --mount.If you u... |
How to use wkhtmltopdf with Docker | When I use wkhtmltopdf (version 0.12.2.4, installed via apt-get) within a Docker container it fails withQXcbConnection: Could not connect to display(When I set the environment variableDISPLAY=unix0, I getQXcbConnection: Could not connect to display unix0which makes sense as no Xserver seems to be installed)There seems ... | Installing version0.12.4(I had0.12.2.2before) solved the problem. SeeHow can I install the latest wkhtmltopdf on Ubuntu 16.04?for the steps. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.