Prompt stringlengths 14 160 | Instruction stringlengths 18 2k | Response stringlengths 8 2k |
|---|---|---|
How to access PersistentVolume files on docker-for-desktop? | I'd like to access and edit files in my KubernetesPersistentVolumeon my local computer (macOS), but I cannot understand where to find those files!I'm pointing myhostPathto/tmp/wordpress-volumebut I cannot find it anywhere. What is the hidden secret I'm missingI'm using the following configuration on adocker-for-desktop... | Thanks to @aman-tuladhar and some hours lost on the internet I've found out that you just need to make surestorageClassNameis set for youPersistentVolumeandPersistentVolumeClaim.As perdocumentationif you want to avoid thatKubernetesdynamically generetesPersistentVolumeswithout considering the one you statically declare... |
Postgres on Docker. How can I create a database and a user? | I'm trying to create simple postgres server with docker. I use the officialpostgres imageas a base for my container.
My Dockerfile contains these commands:FROM postgres
USER postgres
RUN /etc/init.d/postgresql start &&\
psql --command "CREATE USER user WITH SUPERUSER PASSWORD 'user';" &&\
createdb -O user appAn... | It's possible that it takes some time for postgres to start accepting connections. The way you've written it, it will call CREATE USER immediately after the start function returns. Try putting a sleep in there and see if it's still a problem. |
How to use Kitematic with Hyper-V enabled? | I have installed Docker for Windows (running Windows 10). Out of the box, Docker would not install an image on Hyper-V but I was able to get it work.Edit: I acquired Kitematic via the link from this screen:Upon clicking download, I get a zip file via http.Next, I copied Kitematic zip contents to c:\program files\docke... | You only need to deleteKitematicfolder in%APPDATA%(C:\Users\{User}\AppData\Roaming) and run Kitematic again. |
Symbolic Link Host to Docker Container | Well, Basically I wanna create a Symbolic link "ln -s" from my host to my container.To sum up: the host folder .m2 of the host must have a Symbolic link to the .m2 folder inside my container, something like: $ ln -s containerIp:/root/.m2 myContainerAliasI've seen the below posts but they didn't help me since I don't wa... | For further investigation about this question. I would like to notify that I've "solved" my issue with the same approach than @Kai Hofstetter in the following post:How to mount a directory in the docker container to the host? |
Cannot connect to postgreSQL docker container via postico | I'm trying to use Postico to connect to a docker postgreSQL container on my local machine.I've tried connecting to 0.0.0.0, localhost, and 127.0.0.1. Each give me the following error:could not connect to server: Connection refused
Is the server running on host "localhost" (::1) and accepting
TCP/IP connections ... | If postgres version doesn't matter, try to change Postgres image to this one, it works for meAnd also make sure that you add ports indocker-compose.ymlpostgres:
image: postgres
restart: always
environment:
POSTGRES_USER: prisma
POSTGRES_PASSWORD: prisma
ports:
- "5432: 5432"
volume... |
docker build purely from command line | Is there a way to build docker containers completely from the command-line? Namely, I need to be able to set things likeFROM,RUNandCMD.I'm a scenario where I have to use docker containers to run everything (git,npm, etc), and I'd like to build containers on the fly that have prep-work done (such as one withnpm installa... | Update for 2017-05-05: Docker just released 17.05.0-ce with thisPR #31236included. Now the above command creates an image:$ docker build -t test-no-df -f - . < 00f017a8c2a6
Step 2/2 : CMD echo just a test
---> Running in 45fde3938660
---> d6371335f982
Removing intermediate container 45fde3938660
Successfully built d6... |
Run normal Win32 applications in Docker for Windows | I'm a little bit confused about the concept of Docker for Windows.
Can I create a docker container for windows (and a windows host like Server 2016) and install a normal windows application into that container (simple: notepad.exe; advanced some more complex application programmed in Delphi)?
And can I run this contain... | if you have Windows Server 2016, you will be able to launch Windows containers (and you will need a Linux server to launch Linux containers).See those linkshttps://msdn.microsoft.com/en-us/virtualization/windowscontainers/quick_start/manage_dockerhttps://msdn.microsoft.com/en-us/virtualization/windowscontainers/quick_s... |
How to check if a docker instance is running? | I am using Python to start docker instances.How can I identify if they are running? I can pretty easily usedocker psfrom terminal like:docker ps | grep myimagenameand if this returns anything, the image is running. If it returns an empty string, the image is not running.However, I cannot understand how to getsubprocess... | One option is to usesubprocess.check_outputsettingshell=True(thanks slezica!):s = subprocess.check_output('docker ps', shell=True)
print 'Results of docker ps' + sif thedocker pscommand fails (for example you don't start your docker-machine) thencheck_outputwill throw an exception.A simple find can then verify your con... |
What does 'docker images ls' do? | I looked up the docs to understand the difference between commandsdocker image(managing images) anddocker images(list images). So the second option seems to be a shortcut fordocker image lswhich also lists images.What I noticed is, when runningdocker image lsordocker imagesI get a list of all my images as expected, but... | docker image lslists the imagesdocker imagesalso lists the imagesdocker images lslists the images with the repository namels. And as you dont have any images namedlsit is returning an empty list.Reference :https://docs.docker.com/engine/reference/commandline/images/ |
Volumes and docker-compose | I'm trying to create a docker-compose.yml file that contains a--volumes-frominstruction. Does anyone know the syntax?I have been looking online for some time now, and it appears that the--volumes-fromcommand is only available as a docker command. I hope I'm wrong. | Aug. 2022:brandtpoints out inthe commentsto the updateddocker-compose documentation.Note August 2017: withdocker-compose version 3, regarding volumes:The top-levelvolumeskey defines a named volume and references it from each service’s volumes list.This replacesvolumes_fromin earlier versions of the Compose file format.... |
Using docker GELF driver env/labels in logstash | Docker GELF log driver allowsenvandlabelslog-opts:The labels and env options are supported by the gelf logging driver. It adds additional key on theextrafields, prefixed by an underscore (_) (ref)I want to use this in my index name for elasticsearch output but I couldn't figure out how I can access these value or saide... | After reading the PR that added this option, I realised that I misunderstood how it was supposed to work.--log-opt labels=a,b,c(same with env) define keys to include in the GELF event. The values are actually retrieved from docker labels and environment variables respectively.--log-opt labels=foo --label foo=barwill in... |
Dynamic listening ports inside Docker container | I have an application which after making some connections using its default ports starts opening(listening) new RANDOM ports to handle just the existing connection and then drops them (Video calls).It also exchanges its IP address and ports inside the communication protocol, I was able to solve the IP address issue, bu... | The--net=hostoption, for thedocker runcommand, should enables the behavior you are seeking -- note that it is considered as insecure, but I really don't see any other mean of doing this.See thedocker runman page:--net="bridge"
Set the Network mode for the container
'bridge': crea... |
How can I find out how much space is used by my container images from the Google Container Registry | I have pushed container images usinggcloud docker pushto the Google Container Registry. Two questions:How do I see how much space all my images use? (I can see individual images but I want a total in order not to navigate to all and make a sum) | Good questions!All your Docker images are stored in aGoogle Cloud Storagebucket calledartifacts..appspot.com(Replacewith your project's ID)To find the total space, rungsutil du gs://artifacts..appspot.com |
serving static files from jwilder/nginx-proxy | I have a web app (django served by uwsgi) and I am using nginx for proxying requests to specific containers.
Here is a relevant snippet from my default.conf.upstream web.ubuntu.com {
server 172.18.0.9:8080;
}
server {
server_name web.ubuntu.com;
listen 80 ;
access_log /var/log/nginx/access.log vhost;
location / {
inclu... | This answer is based on thiscommentfrom the #553 issue discussion on the officialnginx-proxyrepo. First, you have to create thedefault_locationfile with the static location:location /static/ {
alias /var/www/html/static/;
}and save it, for example, intonginx-proxyfolder in your project's root directory. Then, you h... |
Laravel storage sym:link not working in local environment | I am using the default laravel folder structure and the filesystempublic:'public' => [
'driver' => 'local',
'root' => storage_path('app/public'),
'url' => env('APP_URL') . '/storage',
'visibility' => 'public',
],Everything runs on docker and the complete laravel folder is mounted into/v... | You mentioned that you are using docker. I think the reason that it doesn't work locally, but in production, could be that there is a configuration shift between the two deployments.For it to work the Nginx container must have access to the storage folder, since it is supposed to serve assets that are located there. I'... |
Lots of "Uncaught signal: 6" errors in Cloud Run | I have a Python (3.x) webservice deployed in GCP. Everytime Cloud Run is shutting down instances, most noticeably after a big load spike, I get many logs like theseUncaught signal: 6, pid=6, tid=6, fault_addr=0.together with[CRITICAL] WORKER TIMEOUT (pid:6)They are always signal 6.The service is using FastAPI and Gunic... | Unless you have enabledCPU is always allocated, background threads and processes might stop receiving CPU time after all HTTP requests return. This means background threads and processes can fail, connections can timeout, etc. I cannot think of any benefits to running background workers with Cloud Run except when sett... |
Deprecated java.security.egd=file:/dev/./urandom for Spring Boot applications? | I used to configure-Djava.security.egd=file:/dev/./urandomin my Dockerfile for Spring Boot applications.Inhttps://spring.io/guides/gs/spring-boot-docker/(or GitHubhttps://github.com/dsyer/gs-spring-boot-docker) a comment was added that this is not required any more for newer versions:To reduce Tomcat startup time we ad... | This problem should have been resolved by the JDK Enhancement Proposal :JEP 123, Configurable Secure Random-Number Generation.According to theJDK 8 Security Enhancementsofficial Oracle document, the/dev/./urandomworkaround is no more necessary from JDK 8.SHA1PRNG and NativePRNG were fixed to properly respect the Secure... |
Error trying to create a scheduled task within Windows 2016 Core container | I am trying to build a container which would include a custom scheduled task.
This is my dockerfile:FROM microsoft/windowsservercore
RUN schtasks /create /tn hello /sc daily /st 00:00 /tr "echo hello"I get the following error:ERROR: The task XML contains a value which is incorrectly formatted or
out of range. (43,4):... | The issue has to do with the Container user. By default a scheduled task is created with the current user. It's possible the container user is a special one that the Scheduled Task command cannot parse into XML.So you have to pass the user/ru(and if needed the password/rp) to theschtaskscommand in a Windows Container.T... |
How to install telnet in Docker for Windows 10 | When I run telnet command in Docker it does not run.Could you please tell me how to install telnet in Docker for Windows? | There is a docker image for it:docker run mikesplain/telnet |
Docker alternative to --network host on macOS and Windows | I have two docker containers:databaseapp that consumes the databaseI run my database container like this:docker run --name my-db -p 127.0.0.1:3306:3306 my-db-imageAnd my app container like this:docker run --name my-app --network host -it my-app-imageThis works fine on Linux. I can access the DB from both the host syste... | For multiple services, it can often be easier to create a docker-compose.yml file that will launch all the services and any networks needed to connect them.version: '3'
services:
my-db:
image: my-db-image
ports:
- "3306:3306"
networks:
- mynetwork
my-app:
image: my-app-image
ports:
... |
Can't Access Private MySQL Docker Image From Gitlab CI | I've been trying to pull in a private (custom) MySQL image from my Docker Hub repository to the gitlab-ci.yml pipeline as a service. I have added a before_script that tries to log in to dockerhub with my username and password (CI variables). There's no output in the failed build log suggesting whether the login to Dock... | First thing is to setup GitLab CI to provide credentials of the private docker registry when needed. To do that there isspecific section in docsyou should follow, to be a complete answer that isGet docker registry url, username and password usingdocker loginor some other manner (I had to spend sometime to figure out re... |
Is it feasible to control Docker from inside a container? | I have experimented with packaging my site-deployment script in a Docker container. The idea is that my services will all be inside containers and then using the special management container to manage the other containers.The idea is that my host machine should be as dumb as absolutely possible (currently I use CoreOS ... | This is totally OK, and you're not the only one to do it :-)Another example of use is to use the management container to hande authentication for the Docker REST API. It would accept connections on an EXPOSE'd TCP port, itself published with-p, and proxy requests to the UNIX socket. |
Make docker build fail if tests fail | DockerfileFROM node:carbon
WORKDIR /usr/src/app
COPY package*.json ./
RUN npm install
RUN npm install gulp -g
COPY . .
run gulp build --build
run npm test
EXPOSE 80
CMD [ "npm", "start" ]Tests are ran usingmocha --recursivebuild.shdocker build -t my-app .
echo $?How can I detect that one mocha test fails, thusnpm ... | RUNin a Dockerfile will fail if the exit code of the command is non-zero. If that happens,docker buildwill also fail with a non-zero exit code.Yournpm testscript needs to return a non-zero exit code when the tests fail.For reference, you can check the exit code like this:$ npm test
$ echo $? |
Run old Linux release in a Docker container? | I've got a binary application that won't work on versions of Ubuntu later than Feisty.Is it possible to build a Docker image containing Feisty and run it on my modern system? | You should be able to build your own base image. I'm not aware of any reasons why it should not work.Check out the documentationhttp://docs.docker.io/en/latest/use/baseimages/for a starting point and keep us posted :) |
Docker container exits when using -it option | Consider the following Dockerfile:FROM ubuntu:16.04
RUN apt-get update && \
apt-get install -y apache2 && \
apt-get clean
ENTRYPOINT ["apache2ctl", "-D", "FOREGROUND"]When running the container with the commanddocker run -p 8080:80 , then the container starts and remains running, allowing the default Apache w... | This behaviour is caused by Apache and it is not an issue with Docker. Apache is designed to shut down gracefully when it receives theSIGWINCHsignal. When running the container interactively, theSIGWINCHsignal is passed from the host to the container, effectively signalling Apache to shut down gracefully. On some hosts... |
How to Initialize a Collection in Dockerized Mongo DB | Here below is thedocker-compose.ymlI use to dockerize my MongoDB instance:version: '3.3'
services:
mongo:
image: 'mongo:latest'
ports:
- '27017:27017'
volumes:
- 'data-storage:/data/db'
networks:
mynet:
volumes:
data-storage:
networks:
mynet:The container is created correctly ... | According to theMongoDB docker documentation, you can use this combination to init your db :
Environnement variable MONGO_INITDB_DATABASEThis variable allows you to specify the name of a database to be used
for creation scripts in /docker-entrypoint-initdb.d/*.js (see
Initializing a fresh instance below). MongoDB is fu... |
How to access container from another compose that connected to external network? | Here is compose file with config of container that I wish to connect to from external container (defined in another compose file):version: '3.5'
services:
service-to-connect-to:
build: .
networks:
- my-external-network
networks:
my-external-network:
external: trueand another compose file that con... | First, you have to add both services to same network in order to connect them. So, the latter compose file should be something likeversion: "3.5"
services:
service-to-connect-from:
build .
networks:
- my-external-network
networks:
my-external-network:
external: trueNow that both services are on ... |
Docker compose with subdirectory and live reload | I created an app usingcreate-react-appand set up docker compose to set up the container and start the app. When the app is in the root directory, the app starts and the live reload works. But when I move the app to a subdirectory, I can get the app to start, but the live reload does not work.Here's the working setup:Do... | There's no difference to the pathsinsidethe container when you move your local directory. So you only need to change the local references.The volume mount should come from./clientversion: "2"
services:
client:
build: ./client
ports:
- "3000:3000"
volumes:
- ./client:/code |
How to expose web app for container on two different ports in azure? | Our web app runs on two ports azure web app exposes port 80 by default which we have used for part 1 but for part two we need another port how can we expose it?Our web app runs perfectly on local.Our web app runs perfectly on container instance on two ports (there is an option in Azure for multiple ports while creating... | For your issue, you should know there are differences between Azure Web App and Azure Container Instance.In Azure Web App, you just can use only two ports: 80 and 443. And they are exposed in default. You just need to listen to one of them or both in the container. But in Azure Container Instance, you can expose all th... |
time.LoadLocation works regularly but throws an error on my docker instance! How do I fix it? | time.LoadLocation works regularly but throws an error on my docker instance! How do I fix it?I rant, err := time.LoadLocation("America/New_York")and it returns an error even though it works just fine on my computer and on play.golang.org (https://play.golang.org/p/4VHlaku26T3)However, when I run it on my docker instanc... | Linux Alpine does not have timezone information natively built in.
You need to update your Dockerfile to get that information.and add the commandapk --no-cache add tzdatato the RUN linee.g., for me I have a line that looks like the followingRUN apk update && apk add bash && apk --no-cache add tzdataThis fixed the issue... |
Where do I find DockerCli.exe | I'm trying to switch Docker to Windows containers on my Windows Server Core 1903 machine (no desktop).Thispage says DockerCli should be able to do so:& $Env:ProgramFiles\Docker\Docker\DockerCli.exe -SwitchDaemonThere is noDockerCli.exeafter fresh Docker installation:Directory: C:\Program Files\Docker
Mode ... | FoundDockerCli.exein theDocker Desktoppackage. |
Single Docker image push into AWS elastic container registry (ECR) from VSTS build/release definition | We have a python docker image which needs to build/publish (CI/CD) into AWS container registry.
At the moment AWS does not support for running docker tasks using docker hub private repositories, therefore we have to use ECR instead of docker hub.Our CI/CD pipeline uses docker build and push tasks. Docker authenticatio... | After lot of research, trial and error I found an answer to my own question.AWS provides an extension to VSTS with build tasks and Service Endpoints. You need to configure AWS service endpoint using an account number, application ID, and secret. Then, in your build/release definition;build docker image using out of the... |
AWS lambda read-only file system error, using docker image to store ML model | I am using a docker container image on lambda to run my ML model. My lambda function has a S3 trigger to fetch images. I am trying to run my lambda function but I am getting this error. Can someone please help me?PS - now i am aware /tmp is the only writable directory in lambda but how to solve this with that? | As others have mentioned,/tmpis the only writable directory in any AWS Lambda environments, either using containers or not.Having said that, you should move your entire library (during the lambda runtime --during container image build time doesn't work) to that directory -- such that everything remains connected within... |
Prisma Deploy Docker error "Could not connect to server" | This is steps I have doneprisma initI set postgresql for database in my local(not exist).It created 3 files, datamodel.graphql, docker-compose.yml, prisma.ymldocker-compose up -dI confirmed it running successfullyBut if I callprisma deploy, it shows me errorCould not connect to server at http://localhost:4466. Please c... | Thedocumentation mentions:docker psYou should see output similar to this:$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
2b799c529e73 prismagraphql/prisma:1.7 "/bin/sh -c /app/sta…" 17... |
Laravel 500 error no logs | First of all, according to stackoverflow, this problem occurs when something is wrong with permissions ofbootstrap/cacheandstoragedirectories. And I tried literally every advice on that with no luck.I was happy user of Xubuntu 16.04 at my old laptop, developed one project. Usingdocker-composeto set up development envir... | Add add($exception->getMessage());to theexception handler classright before line 37. Run the request and check the response.If that doesn't avail anything, verify the request is hitting the webserver by checking access and error logs. Check system logs also usingdmesgand similar.Since you mention Docker, if you're usin... |
localstack trying to connect to localhost:4566 when we explicitly have the url set to 4576 | My team is trying to get a local setup for our project. We are running the same docker-compose file with imagelocalstack/localstack:0.8.10. We are running the same shell script. Our script looks like this...awslocal sns subscribe \
--topic-arn arn:aws:sns:us-east-1:123456789012:cx-clientcomm-traffic-controller-sent... | It is known issue. You need to add in docker-compose lockalstack image next propertiesHOSTNAME_EXTERNALhostname: localstackso original docker-compose will looks like:localstack:
container_name: "${LOCALSTACK_DOCKER_NAME-localstack}"
image: localstack/localstack
hostname: localstack
networks:
- anynet
ports:
- "4566... |
Docker container running tomcat - could not access the server using the host IP address | I am trying to build a docker container running tomcat from a docker file. Please find below the Dockerfile content:FROM ubuntu:trusty
MAINTAINER karthik.jayaraman
VOLUME ["/tomcat/files"]
ADD /files/tar/apache-tomcat-7.0.47.tar.gz /usr/local/tomcat
ADD /files/scripts/. /tmp/tomcat_temp
RUN ls /tmp/tomcat_temp
RUN cp ... | Your docker container is running as long as last command is not done. You are booting up your tomcat as a daemon. This makes docker to stop running container as soon as tomcat is started.You can changed your last line to:CMD service tomcat start && tail -f /var/lib/tomcat/logs/catalina.outOr just try using one of precr... |
How to view files inside docker image without running it? (NOTE: THIS QUESTION IS HOW TO READ FILES WITHOUT RUNNING THE CONTAINER) [duplicate] | This question already has answers here:Exploring Docker container's file system(33 answers)Closed3 years ago.Sometimes running the docker image fails so ssh’ing into the container is not an option. in that cases how do we see the content inside container?There is a existing question but mistakenly marked as duplicate.h... | Answering my own question.you can add something like to override the entry point in the Dockerfile and runlsorcatcommand to see inside.ENTRYPOINT ls /etc/fluentd |
Private docker registry and high availability | We are currently running a private registry on one server hosting all our images on it.
If the server crash, we basically loose all our images. We would like to find a way to enable high availability on our images.
An easy solution I see would be to have a registry instance per server.
A load balancer would redirect(R... | There is someinformation on this on the docker-registry website. In short, it seems designed to support multiple registries talking to the same data-store so you shouldn't see any problems.If reliability is a real issue for you, it might be wise to look at one of the commercial offerings e.g.enterprise Hubor theCoreOS ... |
"/bin/sh: 1: [“apache2ctl”,: not found" in docker | I have a simple DockerfileFROM ubuntu
RUN apt-get update
RUN apt-get install -y apache2
RUN apt-get install -y apache2-utils
RUN apt-get clean
RUN apt-get upgrade -y
EXPOSE 80
CMD [“apache2ctl”, “-D FOREGROUND”]I build it with the following statementdocker build -t mywebserver .That works quite well, but when I want to... | You have typographic quotes in CMD (“ ”), use straight quotes ("). – Dan Lowe |
How to start selenium hub and one linked node via docker-compose instead of using docker? | I can start a selenium hub image via:docker run --rm=true -P -p 4444:4444 --name selenium-hub selenium/huband add a firefox worker via:docker run --rm=true --link selenium-hub:hub selenium/node-firefoxGoing onhttp://localhost:4444/grid/consolethen will show the grid just fine.I don't want to use docker each time but h... | selenium_hub:
image: selenium/hub
ports: ["4444:4444"]
selenium_firefox_node:
image: selenium/node-firefox
links:
- "selenium_hub:hub"Whilek0pernikus' answerdoes work, I just wanted to elaborate on the reason why it was failing.The node containers expect to connect to a hub which is resolvable a... |
nginx load balancer - Docker compose | I have a simple flask app running on port 5000 inside the container , and i'm trying to add nginx load balance to scale the app(3 instances)Here is mydocker-composefile :version: "3.7"
services:
chat-server:
image: chat-server
build:
context: .
dockerfile: Dockerfile
... | You have a typo and are not mounting in yournginx.conffile correctly.You spell itngnixin a couple of places in your volumes section and the container runs with the default config (hence default home page).Once you fix that, you will probably hit the error mentioned by @Federkun (nginxwon't be able to resolve the 3 doma... |
Docker Compose cannot connect to database | I'm using nestjs for my backend and using typeorm as ORM.
I tried to define my database and my application in an docker-compose file.If I'm running my database as a container and my application from my local machine it works well. My program connects and creates the tables etc.But if I try to connect the database from ... | Take a look at your/etc/hostsinside thebackendcontainer. You will see192.0.18.1 dir_db_1or something like that. The IP will be different anddirwill represent the dir you're in. Therefore, you must changeTYPEORM_HOST=localhosttoTYPEORM_HOST=dir_db_1.Although, I suggest you set static names to your containers.services... |
How should I setup Traefik on ECS? | In ShortI've managed to runTraefiklocally and onAWS ECSbut now I'm wondering how should I setup some sort of load balancing to make my two services with random IPs available to the public.My current setup on ECS[Internet]
|
[Load balancer on port 443 + ALB Security group on 443]
|
[Target group on port 443 + Se... | AWS ALB vs AWS Network LB depends on who do you want to handle SSL.If you have a wildcard certificate and all your services are subdomains of the same domain ALB may be a good choiceIf you want to use Let's encrypt with traefik Network LB may be a better choiceIn both case your setup will look something like this :[Int... |
Get IP address of Docker with Ansible | I have follow playbook command:- name: Docker | Consul | Get ip
shell: "docker inspect --format {% raw %}'{{ .NetworkSettings.IPAddress }}' {% endraw %} consul"
register: consul_ipAfter run ansible return follow error:fatal: [192.168.122.41]: FAILED! => {"failed": true, "msg": "{u'cmd':
u\"docker inspect --fo... | Trick with bash concatenation ability:shell: "docker inspect --format '{''{ .NetworkSettings.IPAddress }''}' consul"This will stick together{+{ .NetworkSettings.IPAddress }+}into single string in bash.Update: the root cause of this behaviour isdescribed here. |
Docker and mongo-go-driver "server selection error" | I have a MongoDB replica set up and running using Docker and I can access through console, or Robo3T client, in order to run my queries.These are the containers:$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
efe6ae033... | This is due to unresolvedhostnamefrom Docker host. In Docker, the instancesmongo1,mongo2, andmongo3are reachable by those names. However, these names are not reachable from the Docker host. This is evident by this line:Addr: mongo2:27017, Type: Unknown, State: Connected, Average RTT: 0, Last error: dial tcp: lookup mon... |
Setting specific python version in docker file with specfic non-python base image | I want to create a docker image with specifically python 3.5 on a specific base image which is the nvidia/cuda (9.0-base image) the latter has no python environment.The reason I need specific versions is to support running cuda10.0 python3.5 and a gcc version<7 to compile the driver all together on the same boxWhen I ... | You can install from PPA and use it as usual:FROM nvidia/cuda
RUN apt-get update && apt-get install -y --no-install-recommends software-properties-common \
libsm6 libxext6 libxrender-dev curl \
&& rm -rf /var/lib/apt/lists/*
RUN echo "**** Installing Python ****" && \
add-apt-repository ppa:deadsnakes/ppa... |
"correct" way to manage database schemas in docker | I'm developing an open source application consisting of a Java web application and a postgresql database. Ideally it would be deployable similar to the process detailed in theshipyard quickstart:run a data-only containerrun the DB containerrun the application containerIs there a recommended time to set up the database... | We use Postgres and Docker where I work and we ended up doing the following:Copy the Dockerfile from the official Postgres repo so you can make your own image.Modify docker-entrypoint.sh (https://github.com/docker-library/postgres/blob/8f80834e934b7deaccabb7bf81876190d72800f8/9.4/docker-entrypoint.sh), which is what is... |
Access raspistill / pi camera inside a Docker container | I've been trying out my Node.js app on a Raspberry Pi 3 Model B using Docker and it runs without any troubles.The problem comes when an app dependency (raspicam) requiresraspistillto make use of the camera to take a photo. Raspberry is running Debian Stretch and the pi camera is configured and tested. But I cant access... | I've had the same problem trying to work with camera interface from docker container. With suggestions in this thread I've managed to get it working with the below dockerfile.FROM node:12.12.0-buster-slim
EXPOSE 3000
ENV PATH="$PATH:/opt/vc/bin"
RUN echo "/opt/vc/lib" > /etc/ld.so.conf.d/00-vcms.conf
COPY "node_mod... |
What does |1 mean in Docker history | Given thisDockerfile:FROM debian:8.3
ARG TEST=123
RUN echo $TESTWhat does the|1represent in the Docker history?$ docker history 2feee0d8320f
IMAGE CREATED CREATED BY SIZE COMMENT
2feee0d8320f About a minute ago |1 TEST=123 /bin/sh -... | As shownin this issue, this represents abuild-arg(ie the number of args used by to build the image)A good example ishttp_proxyor source versions for pulling intermediate files.TheARGinstruction letsDockerfileauthors define values that users can set at build-time using the--build-argflag:$ docker build --build-arg HTTP_... |
Print only `Names` column from `docker-container ls -la` output | When issuing thedocker container ls -lacommand, the output looks like this:CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
a67f0c2b1769 busybox "tail -f /dev/null" 26 seconds ago Up 25 seconds recursing_liskovI'd like to get only the container's name p... | Rather than playing around with a default output, just print exactly what you are looking for from start. Most docker sub-commands accept a--formatoption which will take ago templateexpression to specify what you exactly want.In your case, I believe the following command should give what you are looking for:$ docker co... |
Optimising cargo build times in Docker | I am developing an API with Rust, and am managing the environments, including the external database with Docker. Every time I make a change to the API code, cargo rebuilds, and since Docker doesn't cache anything to do with theADDstatement to copy the Rust directory over to the container, it re-downloads all the packag... | Docker does cache the layer built from theADD(preferablyCOPY) instruction, provided the sources haven't changed. You could make use of that and get your dependencies cached by copying theCargo.tomlin first, and doing a build.But unfortunately you need something to build, so you could do it with a single source file and... |
Boot2docker/Windows: can't run bash on Ubuntu container | I'm working through "The Docker Book", am on chapter 3, installing and running an Ubuntu container. I'm on Windows 7.1, using Boot2Docker.Here's what happens when I try to run it (this is the second attempt, so it already has a local copy of the image):$ docker run -i -t ubuntu /bin/bash
exec: "C:/Program Files (x86)/... | This works for me:docker run -t -i ubuntu //bin/bashThe double // avoids the conversion[1][1]http://www.mingw.org/wiki/Posix_path_conversion |
How to get a docker container to the state: dead for debugging? | I need to get some containers to dead state, as I want to check if a script of mine is working. Any advice is welcome. Thank you. | You've asked for adeadcontainer.TL;DR: This is how to create a dead containerDon't do this at home:ID=$(docker run --name dead-experiment -d -t alpine sh)
docker kill dead-experiment
test "$ID" != "" && chattr +i -R /var/lib/docker/containers/$ID
docker rm -f dead-experimentAnd voila, docker could not delete the contai... |
Choosing Golang docker base image | Size of the imagesgolangandalpinevary by around300Mb.What are the advantages of usinggolangimage instead of plainalpine? | Short answer: It would be fairer to compare the differences betweengolang:alpineandalpine.At the time of writing, thegolangimage is built off of Debian, a different distribution than Alpine.I'll quote the documentation from Docker Hub:golang:This is the defacto image. If you are unsure about
what your needs are, you ... |
Edit / hide Nginx Server header under Alpine Linux | When I usecurl --headto test my website, it returns the server information.I followedthis tutorialto hide the nginx server header.
But when I run the commandyum install nginx-module-security-headers, it returnsyum: not found.I also triedapk add nginx-module-security-headers, and it shows that the package is missing.I h... | I found the alternate solution. The reason that it shows binary not compatible is because I have one nginx pre-installed under the target route, and it is not compatible with the header-more module I am using. That means I cannot simply install the third party library from Alpine package.So I prepare a clean Alpine OS,... |
Traefik 2.0 "port is missing" for internal dashboard | I'm trying to use traefik 2.0 (!) in docker swarm mode. This is my stack:version: '3.7'
services:
traefik:
image: traefik:latest
ports:
- 80:80
- 443:443
deploy:
replicas: 1
placement:
constraints:
- node.role == manager
preferences:
- spread: no... | Okay, just adding a dummy service port to the labels workslabels:
- traefik.enable=true
- traefik.http.services.justAdummyService.loadbalancer.server.port=1337
- traefik.http.routers.traefikRouter.rule=Host(`127.0.0.11`)
- traefik.http.routers.traefikRouter.service=api@internal
-... |
How are requests to /dev/(u)random etc. handled in Docker? | fordocumentation purposeson our project I am looking for the following information:We are using Docker to deploy various applications which require entropy for SSL/TLS and other stuff. These applications may use /dev/random, /dev/random, getrandom(2), etc.. I would like to know how these requests are handled in Docker ... | A docker container is "chroot on steroids". Anyway, the kernel is the same between all docker containers and the host system. So all the kernel calls share the same kernel.So we can do on our host (in any folder, as root):mknod -m 444 urandom_host c 1 9and in some linux chroot:wget | tar -x
chroot
mknod -m 444 urand... |
How do I use Python to launch an interactive Docker container? | I am working with a Docker image which I launch in interactive mode like so:docker run -it --rm ubuntu bashThe actual image I work with has many complicated parameters, which is why I wrote a script to construct the fulldocker runcommand and launch it for me. As the logic grew more complicated, I want to migrate the sc... | Can we use this ?import os
os.system('docker run -it --rm ubuntu bash') |
Dockerfile: Copy directory from Windows host to docker container | I want to build a Docker image including my custom Powershell modules. Therefore I use Microsoftsmicrosoft/powershell:latestimage, from where I wanted to create my own image, that includes my psm1 files.For simple testing I've the following docker file:FROM microsoft/powershell:latest
RUN mkdir -p /tmp/powershell
COPY ... | You cannot copy files that are outside the build context when building a docker image. The build context is the path you specify to the docker build command. In the case of the instructionC:\temp\docker_posh> docker build --rm -f Dockerfile -t docker_posh:latest .The.specifies that the build context isC:\temp\docker_po... |
Docker port binding not working as expected | Running a Jenkins image in my container which is bound to the host port 9090sudo docker run -itd -p 9090:8080 -p 50000:50000 --name=myjenkins -t jenkins-custom /bin/bashThe output of running$docker port myjenkins50000/tcp -> 0.0.0.0:50000
8080/tcp -> 0.0.0.0:9090I can also see the binding from the host perspectiveps -A... | This is not an answer to this specific question. It is a possible answer to "port mapping doesn't work"I've been caught by this twice.The image name must come last when creating a container from the command lineThis syntax:docker run --name MyContainer MyImage -p 8080:80will create containerMyContainerfromMyImagewithou... |
Docker Alpine and perf not getting along in docker container | First things first:Alpine Version 3.9.0perf[from:http://dl-cdn.alpinelinux.org/alpine/edge/testing]4.18.13Docker 18.09.3 build 774a1f4My DockerfileFROM alpine:latest
# Set the working directory to /app
WORKDIR /app/
# Install any needed packages specified in requirements.txt
RUN yes | apk add vim
RUN echo "http://dl-... | The problem is that Docker by default blocks a list of system calls, including perf_event_open, which perf relies heavily on.Official docker reference:https://docs.docker.com/engine/security/seccomp/Solution:Download the standard seccomp(secure compute)filefor docker. It's a json file.Find "perf_event_open", it only ap... |
Kill a running process like a webserver inside a Docker container without killing the container | i want to kill a running process like a Django webserver inside a Docker container without killing the container itself but for some reason if i dodocker exec -it ps -auxand thendocker exec kill it will kill my docker instance and i don't want that.How can i address this issue? | you can go:docker exec -it bashonce inside the container you can thenkill . This will kill the process but keep the container runningunlessthis is the process the container was started with. |
Linking containers in Docker | Docker allows you tolink containersby name.I have two questions on this:SupposedA(client) is linked toB(service), andB's port is exposed dynamically (i.e. the actual host port is determined by Docker, not given by the user). What happens ifBgoes down and is being restarted?Does Docker update the environment variable on... | I would say: try ;).At the moment, docker as no control whatsoever on the process once started as itexecve(3)without fork. It is not possible to update the env, that's why the links need to be done before the container runs and can't be edited afterward.Docker will try to reassign the same port to B, but there is no wa... |
Dockerfile FROM Insecure Registry | Is there a way to build a docker image from a Dockerfile that uses a base image from a local, insecure registry hosted in Gitlab. For example, if my Dockerfile were:FROM insecure.registry.local:/mygroup/myproject/image:latestWhen I rundocker build .I get the following error:failed to solve with frontend dockerfile.v0: ... | Depending on your version, you may need to include the scheme in the insecure registry definition. Newer versions of buildkit should not have this issue, so an upgrade may also help....
"insecure-registries" : [
"insecure.registry.local",
"http://insecure.registry.local"
]
... |
Is it possible to use Docker without Windows 10 pro? | I need to install Docker on my pc with Windows 10 home. I read that I can only install Docker Toolbox. Is there any way to have the latest Docker version instead without upgrading my pc to windows 10 pro?Thanks | UpdateDocker can now be installed on Windows 10 Home (version 2004 or higher).
Refer to this article for installation instructionshttps://docs.docker.com/docker-for-windows/install-windows-home/Old AnswerDocker for Windows requires Hyper-V, and Hyper-V requires Windows 10 Pro (or Windows Server). So no, you can't run D... |
*1 directory index of "/usr/share/nginx/html/" is forbidden, in mac catalina os | I was try to mount a folder into "/usr/share/nginx/html/" and the Docker consoler shows an error of "[error] 28#28: *1 directory index of /usr/share/nginx/html/ is forbidden". I use this command to mounted volume "docker-share dilrukshi$ docker run -d -p 8080:80 --name web -v ~/docker-share/html:/usr/share/nginx/html... | it looks like a problem with the folder permissions. Try to execute the following:chmod -R 755 ~/docker-share/htmlWhen you map a host folder into the container, the files' ownership is maintained. e.g.If you execute the followingdocker run -it --rm -v "~/docker-share/html:/usr/share/nginx/html" nginx:alpineYou'll get s... |
In Dockerfile how to copy file from network drive | I have a file hosted (can't change that) at//somenetwork/somefiles/myfileIn myDockerfileI would like to:COPY //somenetwork/somefiles/myfile /opt/files/fileIs there anyway to achieve that withDockerfile?
thanks | Not easily, consideringADD or COPYuses theDockerfilecontext(the current folder or below) to seek their resources.It would be easier tocpthat file first to theDockerfilefolder (before adocker build .), and leave in saidDockerfileaCOPY myfile /opt/files/filedirective.Or you could run the container, and use adocker cp //s... |
Overwrite files with `docker run` | Maybe I'm missing this when reading the docs, but is there a way to overwrite files on the container's file system when issuing adocker runcommand?Something akin to theDockerfileCOPYcommand? The key desire here is to be able to take a particularDocker image, and spin several of the same image up, but with different con... | You have a few options. Using something likedocker-compose, you could automatically build a unique image for each container using your base image as a template. For example, if you had adocker-compose.ymlthat look liked:container0:
build: container0
container1:
build: container1And then insidecontainer0/Dockerfi... |
Explain how `<<: *name` makes a reference to `&name` in docker-compose? | Trying to understand how the docker-compose file was created as I want to replicate this into a kubernetes deployment yaml file.In reference to acookiecutter-django's docker-composeproduction.yamlfile:...
services:
django: &django
...By docker-compose design, the name of service here is already defined asdjangobut th... | There are three different things happening, and none of them are specifically compose syntax, rather they are yaml syntax.First is defining an anchor with the&followed by a name. That's similar to defining a variable to use later in the yaml, with the value matching the value of the yaml object where it appears.Next is... |
How can I set the time zone in Dockerfile using gliderlabs/alpine:3.3 | My Dockerfile is:FROM gliderlabs/alpine:3.3
RUN set -x \
&& buildDeps='\
python-dev \
py-pip \
build-base \
' \
&& apk --update add python py-lxml py-mysqldb $buildDeps \
&& rm -rf /var/cache/apk/* \
&& mkdir -p /app
ENV INSTALL_PATH /app
ENV TZ=Asia/Shanghai
WORKDIR $INSTALL... | The usual workaround is to mount/etc/localtime, as inissue 3359$ docker run --rm busybox date
Thu Mar 20 04:42:02 UTC 2014
$ docker run --rm -v /etc/localtime:/etc/localtime:ro busybox date
Thu Mar 20 14:42:20 EST 2014
$ FILE=$(mktemp) ; echo $FILE ; echo -e "Europe/Brussels" > $FILE ; docker run --rm -v $FILE:/etc/ti... |
Use ghcr in Dockerfile in GHA | I would like to use ghcr as cache to store docker image with part which almost do not change in my project (Ubuntu, miniconda and bunch of Python packages) and then use this image in Dockerfile which adds volumes and code of the project to it. Dockerfile is run by Github Actions. How could I reference to ghcr stored im... | How could I reference to ghcr stored image in From statement of Dockerfile?Image references have the registry in front of them, and when not included, will default to Docker Hub. So for a registry like ghcr you want:FROM ghcr.io/path/to/image:tag |
invalid image name in cloud build when using domain-scoped project | I'm trying to build a container with GCP's Cloud Build. I'm using the simple template from thequickstart doc. I've done this before successfully.However, this time I am using a project which is under an "organization". So the project ID ismycompany.com:projectX, rather than simplyprojectX.I am unable to get the build t... | You need to replace the ":" with a "/"gcloud builds submit --tag gcr.io/mycompany.com/project-id/helloworldMore info can be found here:https://cloud.google.com/container-registry/docs/overview#domain-scoped_projects |
How to enable non-docker actions to access docker-created files on my self hosted github actions runner? (rootless docker) | Github recommending running their runner as a non-root user gives rise to someissues surrounding mixing docker and non-docker actions.This is quite annoying because it results in the checkout action not being able to run because it can't access the files created by actions run in docker containers.Can this be solved by... | This problem can be solved by running the github actions runner as root, which somewhat reduces security.A better solution is using rootless docker:Remove docker from your system if you have previously installed it through Ubuntu's default repositories.install docker from Docker's repositoriesas directed here(I also re... |
How to create redis-cluster in docker based environment | I want to create Redis cluster in my docker based environment, Any docker base image that supports replication and allow me to create cluster using docker-compose would be helpful. | Here is my working .yml fileversion: '3.7'
services:
fix-redis-volume-ownership: # This service is to authorise redis-master with ownership permissions
image: 'bitnami/redis:latest'
user: root
command: chown -R 1001:1001 /bitnami
volumes:
- ./data/redis:/bitnami
- ./data/redis/conf/redis.... |
Redis cluster with docker swarm using docker compose | I'm just learning docker and all of its goodness like swarm and compose. My intention is to create a Redis cluster in docker swarm.Here is my compose file -version: '3'
services:
redis:
image: redis:alpine
command: ["redis-server","--appendonly yes","--cluster-enabled yes","--cluster-node-timeout 60000","--c... | For anyone struggling with this unfortunately this can't be done viadocker-compose.ymlyet. Refer to this issueStart Redis cluster #79. The only way to do this is by getting the IP address and ports of all the nodes that are running Redis and then running this command in any of the swarm nodes.# Gives you all the comman... |
Why use docker? Aren't java files like WAR files already running on JVM? | I'm new to using java and have just started getting a grasp of the build process and dependency management system of Maven and Gradle.From what I understand, Docker is a great tool for deploying containers inside of a docker host. I imagine this is useful in the same way Vagrant is (although not functionally the same) ... | Java's "portability" is mostly marketing hogwash.Java programs can make system calls (like filesystem access or forking subprocesses) just like anything else, so the JVM doesn't isolate much of anything unless you're doing fancy things with the security manager.There isn't a single "the JVM", but rather a series of inc... |
MySQL bind-address in a Docker container | I would like to build a container, which enables bind to multiple IP addresses. Bind address is stored inmy.cnf, it is okay. How to define it or maybe comment out with use of aDockerfileto grant remote access? | sedis usually the weapon of choice for such tasks. Taken from the officialmysql dockerfile:RUN sed -Ei 's/^(bind-address|log)/#&/' /etc/mysql/my.cnfThe command comments out lines starting withbind-addressorlogin my.cnf or conf.d/*. |
Docker linked containers, Docker Networks, Compose Networks - how should we now 'link' containers | I have an existing app that comprises of 4 docker containers running on the same host. They have been linked together using thelinkcommand.However, after some upgrades of docker, thelinkbehaviour has been deprecated, and changed it seems. We are having issues where containers are loosing the link to each other now.So, ... | If 2 containers are in the same network, are the same ENV vars automatically exposed on the containers as if they were linked?no, you would now have to use the container names as their hostnames. The new network feature has no idea which ports will be used. Think of this as 2 computers plugged on the same network hub. ... |
Unable to connect to Docker container from host | Just using Docker for the first time so I'm probably making a rookie mistake, but here goes. I am trying to use thereactioncommerce/reactionimage, and it appears to run correctly. However, I cannot seem to connect to the server from the host.I am runningdocker run -p :8080 -it reactionas suggested on theDocker Hub page... | I think your problem will be your-p(publish) flag. Assuming your container is actually listening on port 8080 - try-p 8080:8080which will map localhost:8080 to your container. (Well, technically it'll map0.0.0.0:8080which is all addresses - including external)But I think if you're not specifying something on the left h... |
Docker-swarm >> Cannot connect to the docker engine endpoint | docker version 1.9.1
swarm version 1.0.1why on connecting 3 VMs (bridged net) to swarm. "docker info" shows me all nodesStatus pending.1 of 3 hosts ismanagerall output is from this host. I don't know where to look for.On runningswarm --debug manage token://XXXXXoutput >>*INFO[0000] Listening for HTTP addr=127.0.0.1:237... | Thedocker daemoncan listen on three different types of Socket:unix,tcpandfd.By default,docker daemonjust listen on unix socket.If you need to access the Docker daemon remotely, you need to enable the tcp socket.When creating docker swarm cluster, the swarm manager need to access the docker daemon of swarm agent nodes r... |
Dockerrun.aws.json structure for ECR Repo | We are switching from Docker Hub to ECR and I'm curious how to structure the Dockerrun.aws.json file to use this image. I attempted to modify the name as/:but this is not successful. I also saw the details of private registries using an authentication file on S3 but this doesn't seem like the correct route whenaws ecr ... | So it turns out, the ECS agent was only able to pull images with version 1.7, and that's where mine was falling. Updating the agent resolves my issue, and hopefully it helps someone else. |
aufs au_opts_parse:1155:docker[2010] unknown option dirperm1 | I installed Docker. Now, when my Ubuntu 14.04 Trusty system tries to boot, I get the following messageaufs au_opts_parse:1155:docker[2010] unknown option dirperm1What does this mean, and how can I get my system back to a stable stage to where I can start it up normally. If this would help: I have a container that is se... | Known issue:https://docs.docker.com/engine/reference/builder/#known-issues-runhttps://github.com/docker/docker/issues/783#issuecomment-123705753Upgrading to docker 1.9.1 solved it. |
Can you run a sandbox container within a Cloud Run container? | Let's say I would to let the user upload some python or bash script, execute it in the cloud run and get the result back. To do this I would create a Cloud Run service with a service account that has no permissions to access project resources. I would as well run the script within the nested container so the user canno... | Currently Cloud Run (fully managed) itself runs on a gVisor sandbox itself, so its support for low-level Linux APIs for creating further container environments using cgroups or Linux namespace APIs are probably not going to be possible.However, since gVisor is technically an user-space sandboxing technology (though I'm... |
Windows docker container cannot ping host | I am running a windows docker container on a Windows Server 2016 host, running default configuration.When running the docker container using the command:docker run -it microsoft/windowsservercore powershellWhen I run the command:ping It just says that the request times out.
I have checked that I can ping 8.8.8.8 and go... | I found a workaround (I'm not willing to call it a solution):Windows Container Network Drivers: create a 'transparent' network:docker network create -d transparent transAttach container to this networkdocker run --network=trans ...Important: Please note, that with this network, your container needs to obtain an IP Adre... |
Allow redeploy for "latest" docker tag in Nexus OSS | I'm using nexus to host both maven and docker artifacts. For the docker production artifacts I'd like to turn on "disable redeploy" to ensure the image can never change on the nexus server once it is potentially in production.However, enabling "disable redeploy" appears to make it impossible to re-publish the "latest" ... | In sonartype version 3.21.1 this feature has been added. When the Disable redeploy policy is selected , we get new option: Allow redeploying the 'latest' tag but defer to the Deployment Policy for all other tags.Link:https://issues.sonatype.org/browse/NEXUS-18186 |
Extract lines from Kubernetes log | I'm new to kubernetes and am still trying to extract log from a few lines and write it, if anyone can help me what commands i should execute.If the pod is named bino, and i wanted to extract the lines corresponding to the error unable-to-access-website, and then write them to a certain location, say John/Doe/bino. How ... | You can use grep in linux to fetch the relevant log messages you want:kubectl log bino | grep "error unable-to-access-website" >> John/Doe/Bino/log.txtHope this helps. |
Can not add new user in docker container with mounted /etc/passwd and /etc/shadow | Example of the problem:docker run -ti -v my_passwd:/etc/passwd -v my_shadow:/etc/shadow --rm centos
[root@681a5489f3b0 /]# useradd test # does not work !?
useradd: failure while writing changes to /etc/passwd
[root@681a5489f3b0 /]# ll /etc/passwd /etc/shadow # permission check
-rw-r--r-- 1 root root 157 Oct 8 10:17 /e... | It's failing becausepasswdmanipulates a temporary file, and then attempts to rename it to/etc/shadow. This fails because/etc/shadowis a mountpoint -- which cannot be replaced -- which results in this error (captured usingstrace):102 rename("/etc/nshadow", "/etc/shadow") = -1 EBUSY (Device or resource busy)You can re... |
MYSQL Docker container gives "unknown database" error | I'm using a docker container for MySQL with docker-compose that works just fine.The only problem is that I get the errorunknown database "database_name"the first time I run it every day (after Windows startup)After that, if I stop it and re-run it I get no errors and everything works fine.yaml configuration:version: "2... | I believe you're experiencingthis problem. There's a couple possible solutions there, but I haven't tried them myself as I don't have Docker on Windows:Solution 1 by shayneRemoverestart:alwaysfrom your container. Instead run this command once, it'll create a container that will start your container when the mount is re... |
Redis+Docker+Django - Error 111 Connection Refused | I'm trying to use Redis as a broker for Celery for my Django project that uses Docker Compose. I can't figure out what exactly I've done wrong, but despite the fact that the console log messages are telling me that Redis is running and accepting connections (and indeed, when I dodocker ps, I can see the container runni... | Is Django running in a seperate container that is linked to the Redis container? If so, you should have some environment variables with the Ip and port that Django should use to connect to the Redis container. Set BROKER_URL to use the redis Ip and port env vars and you should be in business. Ditto for RESULT_BACKEND.R... |
GitLab CI docker in docker can't create volume | I'm using docker in docker to host my containers as they work through the pipeline. The container I create from my code is setup to have a volume to pass in a gcloud key to the container. This works perfectly on my local machine, but on the gitlab-runner it doesn't link correctly.From reading this appears to be because... | The other solution given is perfectly valid but I wanted to share my solution:Apparently dind will mount the /build directory so subcontainers can "see" its contents. So by placing the key in"./"it is viewable by those containers. I use$(pwd)because docker run doesn't accept~or.test run:
stage: deploy
script:
... |
How to link docker containers on Container VM with an manifest? | TLDR: Is it possible to link two containers with the container manifest?I'm trying to port theGuestbook Sample app from the Google Container Engine docsto acontainer vm. I'm having troubles to connect the two container vms so the web app can access the redis service.It works, if I'm using the docker command line on the... | There isno link parameter available in the container manifest, so unfortunately you can't do it that way.However, have you tried just setting the REDIS_MASTER_SERVICE_HOST environment variable to 127.0.0.1? I believe that should allow the frontend container to talk to the redis container through the standard networking... |
docker unit test setup | I want to setup a unit test environment for my product. I have a web application build on nginx in Lua which use mysql and redis.I think docker will be good for this although i am new to docker. My application runs on centos server (production server).I am planning to setup different container for mysql,redis and webap... | For an example how we setup our project template you may have a look atphundament/appand its testing setup.We are using a dockerizedGitLabinstallation with acustomized runner, which is able to executedocker-compose.Note! The runner itself is running on a separate Docker host.We are usingdocker-compose.ymlto define thes... |
Create Docker Image For JRE FROM scratch | I am trying to create a image using JRE without any OS. I tried this Dockerfile which does not work.FROM openjdk:11.0.1-jdk-oraclelinux7 as JDK
RUN jlink --no-header-files --no-man-pages --add-modules java.base,java.desktop,java.logging,java.sql --output /jre
FROM scratch
#FROM oraclelinux:7-slim
COPY ... | The hotspot sources do not currently support statically linking. Seehttp://mail.openjdk.java.net/pipermail/hotspot-dev/2013-September/010810.htmlfor more info. |
Receive UDP Multicast in Docker Container | I am using docker compose and hypriotos on a raspberry pi running a node container. I would like to receive udp multicast messages send to 239.255.255.250:1982 in local network. My code is working on other machines outside of docker so I think it's a docker issue.I already exposed port 1982/udp in the docker file and i... | While you can do udp with-p 1982:1982/udpI don't believe docker's port forwarding currently supports multicast. You may have better luck if you disable the userland proxy on the daemon (dockerd --userland-proxy=false ...), but that's just a guess.The fast/easy solution, while removing some of the isolation, is to use t... |
Docker - Alpine Elixir container has unsatisfiable constraints | I have thisDockerfilefor my Phoenix application. When running a promotion with Semaphore CI, my deployment fails and returns this error:ERROR: unsatisfiable constraints:
libssl1.0 (missing):
required by: world[libssl1.0]
pdftk (missing):
required by: world[pdftk]How come it can't fetch these two packages? | Theerlang:20-alpineimage (Dockerfile), which is used as base forelixir:1.6.6-alpine(Dockerfile), has been recently updated from Alpine 3.8 to 3.9 (Github commit).The following has changed between Alpine 3.8 and 3.9:Thelibssl1.0package has been removed, and superseded bylibssl1.1.Thepdftkpackage has been removed in 3.9,... |
In Docker, why is it recommended to run `apt-get` update in the Dockerfile? | Sorry, very new to server stuff, but very curious. Why run apt-get update when building a container?My guess would be that it's for security purposes, if that the case than that'll answer the question. | apt-get updateensures all package sources and dependencies are at their latest version, it does not update existing packages that have been installed. It's recommended that you always runapt-get updateprior to running anapt-get installthis is so when theapt-get installis run, the latest version of the package should be... |
How to build react app using Dockerfile.dev and Yarn | I am trying to run a react app using docker. Here are my steps:I have created a react app usingreact-native-cliand addedDockerfile.devfile. My Dockerfile.dev file contains this code:# Specify a base image
FROM node:alpine
WORKDIR '/app'
# Install some depenendencies
COPY package.json .
RUN yarn install
COPY . .
# Us... | There is an issue with Docker and the last version of react scripts.
Here is a Github thread about it :https://github.com/facebook/create-react-app/issues/8688The (temporary and fastest) solution for your case is to downgrade the version of react-scripts in your package.json file.
From :"dependencies": {
...
... |
Docker: Error code 127 when executing shell script | So I can't seem to figure this out, but I'm getting error code 127 when running a Dockerfile. What causes this error?MyDockerfile:FROM composer as comp
FROM php:7.4-fpm-alpine
COPY --from=comp /usr/bin/composer /usr/bin/composer
COPY ./docker/install-deps.sh /tmp/install-deps.sh
RUN echo $(ls /tmp)
RUN /tmp/install-de... | Docker is executing theinstall-deps.shscript. The issue is with a command insideinstall-deps.shthat is not recognized when docker attempts to run the script.As you can see the script returns anerror code of 127meaning that a command within the file does not exist.For instance - try this:touch test.sh
echo "not-a-comman... |
how to run mongodb replica set in docker compose | I have tried to run mongodb replicaSet in local with mongoldb-community in my Mac I followmongodb docI can run it by this commandmongod --port 27017 --dbpath /usr/local/var/mongodb --replSet rs0 --bind_ip localhost,127.0.0.1but it doesn't run on background, so every time I want to start replica set mongodb I should run... | You can have a mongodb replica-set with this docker-compose services:mongodb-primary:
image: "bitnami/mongodb:4.2"
user: root
volumes:
- ./mongodb-persistence/bitnami:/bitnami
networks:
- parse_network
environment:
- MONGODB_REPLICA_SET_MODE=primary
- MONGODB_REPLICA_SET_KEY=... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.