Prompt
stringlengths
14
160
Instruction
stringlengths
18
2k
Response
stringlengths
8
2k
`docker cp` doesn't copy file into container
I have a dockerized project. I build, copy a file from the host system into the docker container, and then shell into the container to find that the file isn't there. How isdocker cpsupposed to work?$ docker build -q -t foo . Sending build context to Docker daemon 64 kB Step 0 : FROM ubuntu:14.04 ---> 2d24f826cb16 ...
So there was some mix-up with the names of images and containers. Obviously, the cp operation was acting on a different container than I brought up with the run command. In any case, the correct procedure is:# Build the image, call it foo-build docker build -q -t foo-build . # Create a container from the image called ...
Docker Rancher - Permission Denied when using docker from WSL
I have installed Docker Rancher on Windows 10 with dockerd option and WSL on true for my current WSL distribution (Ubuntu). When i try to use docker in WSL2, I had the following error:fpapi@xxx:~$ docker ps Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sock: Get "ht...
The issue is that Docker Rancher installer do not create thedockergroup. Use the following commands:sudo addgroup --system docker sudo adduser $USER docker newgrp docker # And something needs to be done so $USER always runs in group `docker` on the `Ubuntu` WSL sudo chown root:docker /var/run/docker.sock sudo chmod g+w...
Azure Function Docker not working with http trigger
Recently I have created a docker image with Azure Function (Node) having HttpTrigger. This is a basic HttpTrigger which generate by default. I'm developing this on Macbook Pro (MoJave) and I have following tools installed.NodeJs - node/10.13.0 .NET Core 2.1 for macOS Azure Function core tools (via brew)When I run the f...
In Dockerfile, addENV AzureFunctionsJobHost__Logging__Console__IsEnabled=trueto enable logging, the setting isomitted in the basic imageso we have to do it manually for now.If you got 401 Unauthorized, find the file function.json, change authLevel toanonymousif it wasfunction(default value in template). We can't acces...
kubectl delete/create secret forbidden (Google cloud platform)
I was following the following tutorial on continuous integration using gitlab and Kubernetes (in my case on google cloud):https://about.gitlab.com/2016/12/14/continuous-delivery-of-a-spring-boot-application-with-gitlab-ci-and-kubernetes/.At some point in the tutorial you will have to first delete and then create a secr...
RUNgcloud config unset container/use_client_certificateAfter this logout and login. It should work. This happens when you disable Legacy Authorisation in the cluster settings, because the client certificate that you are using is a legacy authentication method
Azure app service docker container 'Service Unavailable'
I have followed the tutorials for building a .net core web application into a docker image, publishing to an azure container registry, and then I have setup my VSTS Release template to deploy the container to the app service.This all appears to work, I can view my image in the container registry, and the deployment app...
I ended up resolving this week, hopefully the answer will help others.When using VSTS Hosted build agents to produce images running off the docker base microsoft/aspnetcore:latest - unless you use the (Linux Preview) hosted build agent, you will get produced a windows container, which will not run on the linux app serv...
Restart flask app in docker on changes
I am using flask-script to run my app:if __name__ == "__main__": manager.run()In docker I have the following:CMD [ "python", "manage.py", "runserver", "-h", "0.0.0.0", "-p", "5000"]Now when I build and run my container the app runs fine. However, if I make changes to my code and save the app does not restart despit...
TheCOPYinstructioncopies new files or directories from and adds them to the filesystem of the container at the path .That means the image has a snapshot of the files as they were when the image was built. When you start a container from that image, it will see the copy of your files in its file system. Modifying the o...
How can I run docker container without entering into container
I have DockefileFROM centos:7So I have no entrypoint in dockerfile. Then I build it to imagesudo docker build -t my_container .Then I start it.sudo docker run -t my_containerAnd I get open tty to containerroot@my_container_id/If I start it without-tit stopped immidiately after start. How can I run docker container with...
You can start your container in adetachedmode:docker run -it -d my_containerThe-doption here means your container will run in "detached" mode, in the background.If you want toattachthe container and drop to a shell, you can use:docker exec -it my_container /bin/bashNote, if your container is based on an alpine image, y...
npm UNABLE_TO_GET_ISSUER_CERT_LOCALLY in docker behind corporate firewall
I am getting an error running npm as root in a Dockerfile.> [runner 5/10] RUN npm install --global pm2: #0 71.79 npm ERR! code UNABLE_TO_GET_ISSUER_CERT_LOCALLYWe have an antivirus/corporate firewall that we can't turn off, which substitutes SSL certificates to inspect traffic.My problem is that becausenpm install --g...
If You post your Dockerfile it will be helpful,but there are multiple options for You.1- instead of usingexportset yourNODE_EXTRA_CA_CERTSwithARGoption in dockerfile, it will be used for all users does not matter if You change your user between builds like this:FROM node:alpine AS deps ARG NODE_EXTRA_CA_CERTS=/etc/ssl...
Docker Installation Error on Windows behind Firewall
I'm trying to install Docker on a Windows computer but I get this message:Running pre-create checks...(default) No default Boot2Docker ISO found locally, downloading the latest release...Error with pre-create check: "Gethttps://api.github.com/repos/boot2docker/boot2docker/releases/latest: dial tcp 192.30.252.124:443: c...
Editing thestart.shfile may come up with other error things.Instead that, just put yourboot2docker.isoin below location as.c:\user\USERNAME\\.docker\machine\cacheand restart your Docker terminal.
How is Python scaling with Gunicorn and Kubernetes?
I am going to deploy a Python Flask Server with Docker on Kubernetes using Gunicorn and Gevent/Eventlet as asynchronous workers. The application will:Subscribe to around 20 different topics on Apache Kafka.Score some machine learning models with that data.Upload the results to a relational database.Each topic in Kafka ...
I recommend you set up anHPAHorizontal Pod Autoscaler for your workers.It will require to set up support for themetrics API. For custom metrics on the later versions of Kubernetesheapsterhas been deprecated in favor of themetrics serverIf you are using the public Cloud like AWS, GCP, or Azure I'd also recommend setting...
Docker Quickstart Terminal. Unable to start the VM
After restarting machine and opening the Docker Quickstart Terminal, I get the following error:Unable to start the VM: C:\Program Files\Oracle\VirtualBox\VBoxManage.exe startvm default --type headless failed: VBoxManage.exe: error: Raw-mode is unavailable courtesy of Hyper-V. (VERR_SUPDRV_NO_RAW_MODE_HYPER_V_ROOT) VBox...
Enable Hyper V as following:Run a command prompt as administrator and execute:dism /Online /Disable-Feature:Microsoft-Hyper-Vreboot andbcdedit /set hypervisorlaunchtype off
Pycharm Remote interpreter on Docker remote: [Errno 2] No such file or directory
As specified in the title I am trying to use Pycharm Professional (2018.2) with a python remote interpreter in a Docker machine hosted on a remote server in my LAN. I created a very simple example by following the help 'https://www.jetbrains.com/help/pycharm/using-docker-as-a-remote-interpreter.html'.Pycharm 2018.2 is ...
The problem lies in the Pycharm 'limit' of managing a docker machine on a remote host 'under the hood'. When inserting the volume mapping in the run / debug configuration, it is interpreted as a local path and therefore, in this case, a path that must be present on the remote server. So, for now, the only option is to ...
Connecting to my local docker Database Instance from Table Plus
I have created a local docker wordpress instance and I am trying to connect to the database with a SQL Client (in my case TablePlus) but I am having trouble.I created the docker containers from a docker-compose.yml file shown here:version: '3' services: db: image: mysql:5.7 volumes: - db_data:/var/...
Just as David has suggested in his comment, you need to add port mapping in docker-compose.yml. So, your modified docker-compose.yml would be something like this:version: '3' services: db: image: mysql:5.7 volumes: - db_data:/var/lib/mysql restart: always environment: MYSQL_ROOT_PA...
panic: dial tcp 127.0.0.1:3306: connect: connection refused
I'm trying connect mysql server from docker using golang gin gorm.The build itself has succeeded, but as shown in the title, the following error has been issued.panic: dial tcp 127.0.0.1:3306: connect: connection refusedTrying to connect in this wayfunc dbConnect() *gorm.DB { db, err := gorm.Open("mysql", "docker:p...
You should connect to connect via container's name insteaddb: image: mysql:5.7.26 container_name: godockerDB environment: MYSQL_USER: docker MYSQL_ROOT_PASSWORD: password MYSQL_PASSWORD: password MYSQL_DATABASE: godocker ports: - "3306:3306"Then you can conenct via container namefunc dbConne...
How to use file from home directory in docker compose secret?
I am trying to build a docker container with private node packages in it. I have followedthis guideto use secrets to reference npmrc file securely to install the dependencies. I can get this to work when building the image directly using a command like this:docker build --secret id=npm,src=$HOME/.npmrc .but I cannot ge...
Sincedocker-compose v2.5.0this is now possible.Dockerfile:# syntax=docker/dockerfile:1.2 RUN --mount=type=secret,id=mysecret,target=/root/mysecret cat /root/mysecretdocker-compose.ymlservices: my-app: build: context: . secrets: - mysecret secrets: mysecret: file: ~/.npmrc
Docker: containers vs local installs
After playing around with Docker for the first time over the week-end and seeing tiny images for everything from irssi, mutt, browsers, etc, I was wondering if local installs of packages are making way for dozens of containers instead?I can see the benefit in keeping the base system very clean and having all these cont...
Jess Frazellewould not disagree with you.In herblog post "Docker Containers on the Desktop", she is containerizing everything.Everything.LikeChrome itself:$ docker run -it \ --net host \ # may as well YOLO --cpuset-cpus 0 \ # control the cpu --memory 512mb \ # max memory it can use -v /tmp/.X11-unix:/tm...
How can i persist my logs/data to local filesystem in docker
have an application running inside docker container. the application writes log messages into local log files. how can i make the log file persistent in case the docker container stops or crashes?Since the container are run time entity ,when i stop the image my logs/data is gone.Thanks, Sohan
You can do this using docker volumes:https://docs.docker.com/userguide/dockervolumes/For example:docker run -v /var/log/docker:/var/log your-imagewill mount the log directory on your local file system. You can also get much fancier, creating containers just for data. It's all explained in the above link.
Host screen turns off when I start X server in docker container
I created docker container with X server inside. I use it for some off-screen OpenGL rendering. This container should work on any system (with or without X server running) and it should use hardware GPU if it exists (so I cannot use xvfb).When I use this container on server-like system without GUI, everything works per...
I don't think this is going to work - you're effectively trying to use two X servers - the host and the container - and I suspect they are both expecting to have exclusive use of the video card.What you can do instead is use the X server on the host from the container by bind-mounting the X Server socket. This SO answe...
ASP.NET Core + Docker + Expose wwwroot
I am trying to run an ASP.NET Core application using Docker and I would like to expose the external wwwroot folder to the container, so that when I make changes to it from the outside, they are automatically available to my app. Is this possible, using volumes?
Yes it is possible. If you use docker run then you should do belowdocker run -v /path/on/host:/wwwroot/path/in/container If you usedocker-composethen you should add below to the serviceversion: "3" services: myapp: build: . volumes: - /path/on/host:/wwwroot/path/in/containerIf you are using this on Dock...
install packages from docker-compose.yml into docker container
I am a beginner with docker and docker-compose and i need your help.I'm making PHP-NGINX-PostgresSQL symfony developement environment using docker-compose.Here it is :web: image: nginx:1.13.5 ports: - "80:80" volumes: - ./html:/html - ./site.conf:/etc/nginx/conf.d/default.conf li...
To get a PHP docker container with the intl extension, you need to extend the official PHP image.To do so, declare the use of your ownDockerfilefor your PHP image indocker-compose.yml:services: php: # Remove this line # image: php:7-fpm # Add this one instead build: './docker/php' # ...Then, add ...
In docker, can I publish a volume with initial data?
I want to share a file storage between two containers. From the documentation, I've seen that you can create and use volumes like this:docker volume create --name DataVolume1 docker run -ti --rm -v DataVolume1:/datavolume1 ubuntuHowever, I want containers to be able to access an initial set of shared data. Does docker ...
With a named volume (not with a host volume, aka bind mount) docker will initialize an empty named volume to the contents of the image at the location you mount it. So if you have files in your image at /datavolume1, and DataVolume1 is empty, docker will copy those files into the named volume.
Conflict. The container name "/gitlab-runner" is already in use by container
I'm following thisguideto install docker for my GitLab server running on Ubuntu 16.4.When I execute the following command:docker run -d --name gitlab-runner --restart always \ -v /srv/gitlab-runner/config:/etc/gitlab-runner \ -v /var/run/docker.sock:/var/run/docker.sock \ gitlab/gitlab-runner:latestSo far so good...
Just to add my 2-cents as I've also recently been through those GitLab documents to get the Docker GitLab runner working.Following theDocker image installation and configurationguide, it tells you to start that container, however that I believe, is a mistake, and you want to do that after registering the Runner.If you ...
Docker: Refer to registry by ip address
I have a Docker image I want to push to my registry (hosted onlocalhost). I do:docker push localhost:5000/my_imageand works properly. However, if I tag the image and push it by:docker push 172.20.20.20:5000/my_imageI get an error.The push refers to a repository [172.20.20.20:5000/my_tomcat] (len: 1)unable to ping regis...
As mentioned in "IPs for all the Things" (byJess Frazelle), you should be able, with docker 1.10, to run your registry with a fixed IP address.It uses the--net= --ip=options of docker run.# create a new bridge network with your subnet and gateway for your ip block $ docker network create --subnet 203.0.113.0/24 --gatew...
Unable to locate package while building Docker image
During my Docker container build process, I attemptted to install a few packages using apt-get install. However the process failed to complete because the 3 of the 4 packages could not be found.Step 1 : RUN apt-get update && apt-get install -y netcat ca-certificates build-essential libssl-dev ---> Running in 38d22...
This issue revolved around the host's network configuration. The eth0 interface was improperly configured. The following commands helped me determine it was a DNS issue.$ docker run --rm debian:jessie ping -c 5 google.com ping: unknown host $ docker run --rm debian:jessie ping -c 5 8.8.8.8 PING 8.8.8.8 (8.8.8.8): 56 da...
docker-compose logging is not working with syslog option
I have the following docker-compose configuration:version: '3' services: worker: image: // image logging: driver: syslog options: syslog-address: "udp://XXX.papertrailapp.com:XXXX" tag: "{{.Name}}/{{.ID}}"When I deploy this to DigitalOcean under Ubuntu, I can successfully run thedo...
This does in fact work. I erroneously had the papertrail details misconfigured so I was not seeing the logs.
Docker basics, how to keep installed packages and edited files?
Do I understand Docker correctly?docker run -it --rm --name verdaccio -p 4873:4873 -d verdaccio/verdacciogets verdaccio if it does not exist yet on my server and runs it on a specific port. -d detaches it so I can leave the terminal and keep it running right?docker exec -it --user root verdaccio /bin/shlets me ssh into...
You can usedocker committo build a new image based on the container.A better approach however is to use aDockerfilethat builds an image based onverdaccio/verdacciowith the necessary changes in it. This makes the process easily repeatable (for example if a new version of the base image comes out).A further option is the...
"oc new-app" does not expose port altough the input image does
I'm exploring OpenShift 3.9 and have managed to get a first container built and running withoc new-appand the Docker build strategy. My Dockerfile includes the commandEXPOSE 5432.After the rolloutoc describe istag/my_app:latest | grep ^ExposesreportsExposes Ports: 5432/tcp, so that looks good: the image exposes port 54...
In the end, the problem "suddenly" went away andoc new-appnow indeed exposes the port (as the documentation says). I am so far using a trivialDockerfilesuch as thisFROM debian:stretch EXPOSE 5432 COPY start.sh /usr/local/bin/start.sh CMD ["start.sh"]wherestartup.shcallssleep infinity. In terms of explanation, I can o...
Publish build artifact task results 'path does not exist' error
I am trying to push an image to AKS using the default Azure DevOps template:stages: - stage: Build displayName: Build stage jobs: - job: Build displayName: Build pool: vmImage: $(vmImageName) steps: - task: Docker@2 displayName: Build and push an image to container registry inp...
Ok - at this stage I have to admin, that I had a thorough misunderstanding about artifacts in build pipelines.Theupload(deprecated) andpublishtasks are short-hand for the Publish Pipeline Artifact task (https://learn.microsoft.com/en-us/azure/devops/pipelines/artifacts/pipeline-artifacts?view=azure-devops&tabs=yaml)Se...
Volume changes not persistent after "docker-compose run" command (Django's collectstatic)
I have a Django environment that I create with Docker Compose, and I'm trying to usemanage.py collectstaticto copy my site's static files to a directory in the container. This directory (/usr/src/app/static) is also a Docker Volume.After building my docker containers (docker-compose build), I rundocker-compose run web...
Runningdocker-compose run ...starts a new container and executes the command in there. then when you rundocker-compose upit creates ANOTHER new container... which doesn't have the changes from your previous command.What you want to do is start up a data container to hold your static files. Add another container to yo...
Java JVM on Docker/CoreOS
I'm learning CoreOS/Docker and am trying to wrap my mind around a few things.With Java infrastructure, is it possible to use the JVM in it's own container and have other Java apps/services use this JVM container? If not, I'm assuming the JVM would have to be bundled in each container, so essentially you have to pull th...
It is actually possible to just untar Orcale Java in/opt, but that's just a kind of last resort. The Oracle binaries of JRE and JDK don't require any system libraries, so it's pretty easy anywhere.I have written some pretty smallJREandJDKimages, with which I was able to runElasticsearchand other major open-source appli...
How to setup flask-socketio in a docker container?
Hello I'm trying to setup flask-socketio in a docker container. It seems to run but I get an error( from the browser) when I try to access localhost on port 5000 like I'm used to do with flask apps. It say's: unable to connect!I will show you the 5 important files: Dockerfile, requirements.txt, docker-compose.yml, web...
When starting compose, make sure all environment variable are set for flask. Also provide the--host=0.0.0.0to listen on all network interfaces, in your entrypoint or command.The updated docker-compose file:version: "3" services: web: build: ./web volumes: - './application:/application' ...
How to serve static content with Nginx and Django Gunicorn when using Traefik
I have a web application (Django based) that is utilising multiple containers:Web Application (Django + Gunicorn)Traefik (acting as the reverse proxy and SSL termination)Database which is used with the Web applicationRedis which is used with the Web applicationAccording to some of the documentation I have read, I shoul...
If anybody else needs an answer to this, the answer lies in creating a seperate NGINX service and then directing the front end rules to the static location (xyz.com/static), e.g. see below (part of docker-compose.yml):nginx: image: nginx:alpine container_name: nginx_static_files restart: always ...
Curl could not resolve host using Docker on WSL 2
I am trying to use curl to download releases from github and it cannot seem to resolve the domain.I get the errorcurl: (6) Could not resolve host: objects.githubusercontent.comI am running Docker on WSL 2. Part of my Dockerfile is below and it doesn't get past thecurlcommandFROM alpine:latest WORKDIR /app RUN apk updat...
In case you don't use the Docker Desktop app and have installed Docker in the WSL2 Ubuntu instance, edit/create a config file:/etc/docker/daemon.jsonand set default DNS:{ "dns": ["8.8.8.8"] }Restart the Docker service:service docker restart
Using Laravel Sail with a separate testing database
I'm using Laravel Sail as my development environment. According to thedocs,when the MySQL container is starting, it will ensure a database exists whose name matches the value of your DB_DATABASE environment variable.This works perfectly for my development environment, but not so much when it comes to testing since my....
Add the following todocker-compose.ymlunder theservices:key and set your host in.env.testingtomysql_test:mysql_test: image: "mysql:8.0" environment: MYSQL_ROOT_PASSWORD: "${DB_PASSWORD}" MYSQL_DATABASE: "${DB_DATABASE}" MYSQL_USER: "${DB_USERNAME}" MYSQL_PASSWORD: "${DB_PASSWORD}" ...
How to run cron jobs inside php-fpm-alpine docker container?
Hi I don't know how can I run a cron job insidethiscontainer.I've found this:How to run a cron job inside a docker containerBut that overrides the CMD, I don't know hot to keep php-fpm working
When you need to run multiple processes in your docker container a solution is to usesupervisordas the main instruction. Docker will start and monitorsupervisordwhich in turn will start your other processes.Docker File Example:FROM debian:9 ... CMD ["/usr/bin/supervisord", "-c", "/etc/supervisor/my.conf"]Supervisord co...
SQL Server Docker container immediately exiting
I am trying to run a SQL Server container on my mac through Docker.I ran the following command:docker run -e "ACCEPT_EULA=Y" -e "SA_PASSWORD=strongpassword" -p 1433:1433 --name sqlservercontainer -d mcr.microsoft.com/mssql/server:2019-latestBut the container is immediately exiting.The docker logs for the container look...
If you use thesudocommand to create a folder outside of your home directory structure for use by Docker then that folder is going to be owned by therootuser, e.g.:$ sudo mkdir /var/mssql-data $ ls -la /var/mssql-data total 0 drwxr-xr-x 2 root wheel 64B 26 May 11:31 ./ drwxr-xr-x 30 root wheel 960B 26 May 11:...
Docker volume and host permissions
When I run a docker image for example likedocker run -v /home/n1/workspace:/root/workspace -it rust:latest bashand I create a directory in the container likemkdir /root/workspace/testIt's owned by root on my host machine. Which leads to I have to change the permissions everytime after I turn of the container to be able...
Sure, becauseDockerusesrootas a default user. You should create user in your docker container, switch to that user and then make folder, then you will get them without root permissions on you host machine.DockerfileFROM rust:latest ... RUN useradd -ms /bin/bash myuser USER myuser
How persistent are docker data-only containers
I'm a bit confused about data-only docker containers. I read it's a bad practice to mount directories directly to the source-os:https://groups.google.com/forum/#!msg/docker-user/EUndR1W5EBo/4hmJau8WyjAJAnd I get how I make data-only containers:http://container42.com/2014/11/18/data-only-container-madness/And I see some...
Docker containers will persist on disk until they are explicitly deleted withdocker rm. If your server restarts you may need to restart your service containers, but your data containers will continue to exist and their volumes will be available to other containers.
Docker Compose: cannot run ssh: No such file or directory
I'm trying to use docker-compose to fetch, build and run multiple services from their git repositories. I made a simple docker-compose.yml to test it:version: '3' services: test-service: build:[email protected]:dan-poltherm/partservicego.git ports: - 8005:443It seems that docker-compose can't fetch rep...
Personal access tokenis a way to go
Running powershell or cmd on docker container
I want to check the content of my docker container. I want to run apowershellor command prompt inside container so I can list directories.This container image is hostingASP.NET Web APIapplication using ASP.net4.6.1framework.I ran following commands:docker container ls - to list conatinersdocker exec -i -t a1da40af6b3c ...
ISE hosted powershell does not work properly with a bunch of things. So try to do this either inside standalone powershell console or use VS Code.
Azure Devops: Docker Build task image name starts with ***/
I am running a Docker task 'buildAndPush'in Azure Pipeline yaml file, to build my repository image and push to ACR. This work perfectly fine and i could see my image in docker and ACR.However, I want to break this task. I want to build the image in docker. I want to run the docker image locally once, then run the test ...
When you connect your docker build task to ACR. The docker image will be prefixed by your registry URI. The***in***/myrepositoryis your registry URI encrypted.So you need to specify your image asYour_ACR_URI/myrepository:$(Build.BuildId)in the docker run command. See below example:- bash: docker run 'leviacr.azurecr.io...
Building Go Application using confluent-kafka-go on Linux
I am trying to create a docker image with my go application. The application (which was developed on MacOS) depends onconfluent-kafka-gowhich in turn depends onlibrdkafka-devwhich I install in the Docker image like so:FROM golang:1.1 RUN apt-get update RUN apt-get -y install librdkafka-dev VOLUME /workspace WORKDIR /w...
I had a similar issue a few weeks ago. IIRCconfluent-kafka-gorequires a recent version oflibrdkafka-dev, which simply was not yet released to alpine or others. I was able to find it for ubuntu though, so my solution (which was more involved than I hoped for, but it worked), was to start from clean ubuntu, installlibrd...
How to make microk8s ctr image prune
I'm getting a low disk space warning on a server where my microk8s and applications are installed. When I run the microk8s ctr image ls command, multiple images appear for an application. Does the "docker image prune -f" command in Docker have an equivalent in microk8s? Or is there a way possible?
If you want to delete all custom added images from the built-in library, you can do this:# get all images that start with localhost:32000, output the results into image_ls file sudo microk8s ctr images ls name~='localhost:32000' | awk {'print $1'} > image_ls # loop over file, remove each image cat image_ls | while rea...
List volumes of Docker container
How can I list all the volumes of a Docker container? I understand that it should be easy to get but I cannot find how.Also, is it possible to get the volumes of deleted containers and remove them?
You can use docker ps, get container id and write:$docker inspect container_idlike here:"Volumes": { .. }, "VolumesRW": { .. }It would give you all volumes of container.
User not found on MongoDB Docker image with authentication
So I'm trying to setup a MongoDB using the officialmongo Docker image, version4.2.What I want to achieve is to use the server with authentication enabled, and I want to have a custom database with a custom user and password.So, I'm setting the following environment variables:MONGO_INITDB_DATABASE: mydb MONGO_INITDB_ROO...
You can authenticate withjane,secretagainstadmindb, notmydbRunningmongo -u jane -p secretis equivalent to runningmongo -u jane -p secret -authenticationDatabase admin. Check container logs to verify it.MONGO_INITDB_DATABASE is for different purpose.Asdocsstate:MONGO_INITDB_ROOT_USERNAME, MONGO_INITDB_ROOT_PASSWORD Thes...
Docker: Files from volume not updated in target
I'm newbie in Docker and I have created an image with this Dockerfile:FROM node:8.12.0 LABEL version="1.0" WORKDIR /usr/src/app COPY package*.json ./ RUN npm install COPY . . EXPOSE 8080 CMD ["node", "index.js"]I run the image and it works. But If I run the image mapping host directory with WORKDIR when I update index....
Looks like known issue.LinkIf you are using some editor like vim, when you save the file it does not save the file directly, rather it creates a new file and copies it into place. This breaks the bind-mount, which is based on inode. Since saving the file effectively changes the inode, changes will not propagate...
Kubernetes cluster is not exposing external ip as <nodes>
Here is my service.yaml code :kind: Service apiVersion: v1 metadata: name: login spec: selector: app: login ports: - protocol: TCP name: http port: 5555 targetPort: login-http type: NodePortI wrote service type astype: NodePortbut when i hit command as below it does not show the external ip as...
There is nothing wrong with your service, you should be able to access it using:32436.NodePort, as the name implies, opens a specific port on all the Nodes (the VMs), and any traffic that is sent to this port is forwarded to the service. So, On your node port 32436 is open and will receive all the external traffic on t...
Using proxy on docker-compose in server
When i runsudo docker-compose buildi getBuilding web Step 1/8 : FROM python:3.7-alpine ERROR: Service 'web' failed to build: error parsing HTTP 403 response body: invalid character '<' looking for beginning of value: "403 Forbidden\nSince Docker is a US company, we must comply with US export control regulations. In an ...
You must be from restricted countries which are banned by docker (from403status code). only way is to use proxies in your docker service.[Service]...Environment="HTTP_PROXY=http://proxy.example.com:80/ HTTPS_PROXY=http://proxy.example.com:80/"...after that you should issue:$ systemctl daemon-reload $ systemctl restart ...
Boot2Docker for OS X fails to start
I am new to docker and I'm attempting to run boot2docker on my work computer. I'm logged in to the computer running OS X version 10.10.1 (Yosemite) with a user account that mounts the home directory from the office network.I installed Docker v1.4.1 fromhttps://github.com/boot2docker/osx-installer/releasesand VirtualBox...
Finally, this solution worked for me. I have to move the VirtualBox VMs folder from my network home directory to my local machine and change their permissions.So on my VirtualBox GUI, under Settings>Storage, I changed the file locations from/Network/Servers/servername/Volumes/cal/Users/username/VirtualBox VMs/boot2dock...
How to start mongodb from dockerfile
I'm building a dockerfile. But I meet a problem. It says that :/bin/sh: 1: mongod: not foundMy dockerfile:FROM mongo:latest FROM node RUN mongod COPY . . RUN node ./scripts/import-data.jsHere is what happen when docker build:Sending build context to Docker daemon 829.5MB Step 1/8 : FROM rabbitmq ---> e8261c2af9fe S...
The problem is that you are using twoFROMinstructions, which is referred to as amulti-stage build. The final image will be based on thenodeimage that doesn't contain themongodatabase.* Edit *here are more details about what is happening:FROM mongo:latestthe base image ismongo:latestFROM nodenow the base image isnode:la...
database lost on docker restart
I'm running influxdb and grafana on Docker with Windows 10.Every time I shut down Docker, I lose my database.Here's what I know:I have tried adjusting the retention policies, with no effect on the outcomeI can shut down and restart the containers (docker-compose down) and the database is still there. Only when I shut d...
If you are usingdocker-compose down/up, keep in mind thatthis is not a "restart"because:docker-compose upcreates newcontainers anddocker-compose downremoves them:docker-compose upBuilds, (re)creates, starts, and attaches to containers for a service.docker-compose downStops containers and removes containers, networks, v...
how to run .sh file when container is running using dockerfile
I'm making a dockerfile to install elasticsearch:6.5.4 and add few files to required locations and run a script named test.sh to create a new index in elasticsearch while elasticsearch is running.I'm not sure whether i should use RUN, CMD or ENTRYPOINT to do that.I've successfully built an image and run a container by ...
At a purely mechanical level, the quotes are causing trouble. When you sayRUN "sh test.sh"it tries to run a single command namedsh\ test.sh; it does not try to runshwithtest.shas a parameter. Any of the following will actually run the scriptRUN ["sh", "test.sh"] RUN sh test.sh RUN chmod +x test.sh; ./test.shAt an ope...
How can I run a cron in MariaDB container?
I want to include a cron task in a MariaDB container, based on the latest imagemariadb, but I'm stuck with this.I tried many things without success because I can't launch both MariaDB and Cron.Here is my actual dockerfile:FROM mariadb:10.3 # DB settings ENV MYSQL_DATABASE=beurre \ MYSQL_ROOT_PASSWORD=beurette COP...
Elaborating on @k0pernikus's comment, I would recommend to use a separate container that runs cron. The cronjobs in that container can then work with your mysql database.Here's how I would approach it:1. Create a Cron Docker ContainerYou can set up a cron container fairly simply. Here's an example Dockerfile that shoul...
Deploying Django with Docker on Amazon Elastic Beanstalk
I have a conceptual question here- I'm looking to deploy a Django application on Elastic Beanstalk (which I've successfully done before) using a Docker (which I have yet to succeed with). I know the Elastic Beanstalk image prebuilt with Docker uses Ngnix, which I've deployed Django with before, but I'm a little lost on...
Ok, so StackOverflow is being a pain about posting this answer (Seems to not like all the config snippets). So here's the link to the Githubhttps://github.com/AndrewSmiley/django-docker-eb. Basically the README is the post I tried to add here to StackOverflow, but unsuccessfully.
Ubuntu 18.04 - Error response from daemon: Get https://registry-1.docker.io/v2/: proxyconnect tcp: tls: oversized record received with length 20527
I am having issue with Docker on Ubuntu 18.04 withdocker-ce. While pulling a container:$ docker pull nginxor while trying to login$ docker loginI get the following message:Error response from daemon: Gethttps://registry-1.docker.io/v2/: proxyconnect tcp: tls: oversized record received with length 20527I also purged a...
I had the same issue yesterday. Since I am behind a company proxy, I had to define the http-proxy for the docker daemon in:/etc/systemd/system/docker.service.d/http-proxy.confThe problem was, that I misconfigured the https_proxy, how it is describedhere. I usedhttps://in the https_proxy environment variable, which cau...
org.reflection.Reflections 0.10.2 fails when running as jar (e.g. in a docker container)
I used org.reflections (latest):new Reflections("my.package").getSubTypesOf(MyService.class);It works well running in IntelliJ and returns all implementations ofMyService.class.But running in a docker container, it returns an emptySet.(Anything else works well in the docker-container)Any ideas? TIA!
This answer results from the comments ...The problem is the following bug/issue:https://github.com/ronmamo/reflections/issues/373- 'Reflections does not detect any classes, if base class (or package prefix) is passed as argument, and application is running as a jar'But it works (for me) with the workaround, suggested i...
Can (should) Docker be used for winforms applications?
I have heard that docker solves the "works on my machine" issue for application deployment and that SQL Server can be run inside a docker container, running in Docker for Windows.I have a C# Windforms application that I would like to deploy without Dll Hell.Is it possible to use Docker for this?
sort of, but i wouldn't.docker isn't meant for interactive / gui based applications at this point. there are some workarounds for this, but all of them are difficult from what I've read.it's better to think of Docker as a server. you don't have a person sitting at a server all day long, clicking things to respond to re...
creating a separate docker-compose configuration for production and development
I have adocker-composesetup for development, and I need to replicate the same file for production or staging.Currently, aside fromvolumesportsandenvironmentI am not quite sure what settings "may need" to be changed for production/environment.To clarify:I have to changevolumes, because I usually mount a USB drive to my ...
The exact list would depend on your environment/ops team requirements, but this is what seems to be useful besides ports/existing volumes:NetworksThe default network might not work for your prod environment. As an example, your ops team might decide to put nginx/php-fpm/mariadb on different networks like in the follow...
Running docker as non-root user OR running jenkins on tomcat as root user
I am trying to build a docker image using docker-maven plugin, and plan to execute the mvn command using jenkins. I have jenkins.war deployed on a tomcat instance instead of a standalone app, which runs as a non-root user. The problem is that docker needs to be run as root user, so maven commands need to be run as root...
The problem is that docker needs to be run as root user, so maven commands need to be run as root user,No, a docker run can be done with a-u(--user) parameterin order to use a non-root user inside the container.Either run docker as non-root userYour user (on the host) needs to be part of thedockergroup. Then you can ru...
Can I show data in specific layer from an docker image? And how?
Each docker image consists of a series of layers.Ex: custom-elasticsearch:lastest$: docker history custom-elasticsearch IMAGE CREATED CREATED BY SIZE COMMENT 5f14f49e0f6b 8 days ago /bin/sh -c #(nop) EXPOSE 9091/tcp 9200/tcp ...
Update:There is a very useful tool calleddivethat allows you to navigate through the Docker layers and view the filesystem.
Supervisor & Docker: How to exit Supervisor if a service doesn't start?
I'm currently using Supervisor inside my Docker images to start and manage my services and I would like to configure Supervisor to exit if at least one of these services entered FATAL state.Doing that, I want to avoid to have Docker containers in running state when nothing except Supervisor has succeeded to start.
You can do this with a Supervisorevent listener. Subscribe it to the eventPROCESS_STATE_FATAL, and respond to the event by sending a SIGTERM to supervisord, which you are presumably running as PID 1 within the container.
ModuleNotFoundError: No module named 'app' fastapi docker
FROM python:3.8 WORKDIR /app COPY requirements.txt / RUN pip install --requirement /requirements.txt COPY ./app /app EXPOSE 8000 CMD ["uvicorn", "app.main:app", "--host=0.0.0.0" , "--reload" , "--port", "8000"]when i useddocker-compose up -dModuleNotFoundError: No module named 'app'the folders in Fastapi framework:...
CMD ["uvicorn", "main:app", "--host=0.0.0.0" , "--reload" , "--port", "8000"]Your work directory is /app and the main.py file is already there. So you don't need to call app.main module. Just call main.py script directly in CMD.
The command returned a non-zero code: 127
I'm trying to build the below Dockerfile, but it keeps failing onRUN ocp-indent --helpsayingocp-indent: not found The command '/bin/sh -c ocp-indent --help' returned a non-zero code: 127FROM ocaml/opam WORKDIR /workdir RUN opam init --auto-setup RUN opam install --yes ocp-indent RUN ocp-indent --help ENTRYPOINT ["oc...
This is a PATH related issue and profile. When you usesh -corbash -cthe profile files are not loaded. But when you usebash -lcit means load the profile and also execute the command. Now your profile may have the necessary path setup to run this command.Edit-1So the issue with the original answer was that it cannot work...
Install packages on jboss/keycloak
When running locally ajboss/keycloakcontainer, I try to add more software.So far, I have tried:~# yum install jq bash: yum: command not found ~# apt-get install jq apt-get: command not foundDoes anybody know how can I install more software?# uname -a Linux 935559ef2e4c 4.19.76-linuxkit #1 SMP Tue May 26 11:42:35 UTC 2...
The container itself is usingRedHats Universal Base Imageand seems to usemicrodnffor managing software.Check the dockerfile of jboss/keycloak (https://hub.docker.com/r/jboss/keycloak/dockerfile) to check, how it's done. The interesting part is:RUN microdnf update -y && microdnf install -y glibc-langpack-en gzip hostnam...
Docker compose detached mode not working
Q. How to run docker-compose in detach modeI am trying to run docker-compose in detach mode but itwill exits after just it's run, but I am able run same image in detach mode using 'docker run' command.Run image using 'docker run' command(works in detach mode)docker run -itd ubuntu:16.04below is output of 'docker ps -a'...
I just had to add tty: true to my docker-compose.ymlversion: '2' services: ubuntu: image: ubuntu:16.04 tty: trueDocker version 1.12.5, build 7392c3bdocker-compose version 1.7.1, build 0a9ab35
How to share .sock file between nginx docker and uwsgi docker?
I'm using docker-compose and now have two docker containers - one is a nginx webserver, whereas the other one is ubuntu with Python uwsgi and Flask.As I know, the best way to connect nginx and uWSGI is done by sharing a *.sock file between them and pass the requests into the file (And that what I do in older projects w...
You don't need to share the sock file with different docker container.The simple solution is share the socket port between dockers.In the uwsgi file need to addsocket=:3000.[uwsgi] master=true chdir=. module=flaskapp harakiri=60 callable=app thunder-lock=true socket=:3000 workers=12 threads=4 chmod-socket=666 vacuum...
How to create a new Kubernetes cluster on Docker Desktop?
I can't seem to figure out how to create a totally new Kubernetes cluster on a Docker Desktop running instance on my computer. (It shouldn't matter if this was a Mac or PC).I know how to -set- the current cluster context, but I only have one cluster so I can't set anything else.### What's my current context pointing to...
Kubernetes config file describes 3 objects:clusters,users, andcontexts.cluster- cluster name + details - the host and the certificates.user- user name and credentials, to authorise you against any cluster host.thecontextrole is to make the connection between auserand acluster, so when you use that context,kubectlwill a...
Bash parse docker status to check if local image is up to date
I have a starting docker script here:#!/usr/bin/env bash set -e echo '>>> Get old container id' CID=$(sudo docker ps --all | grep "web-client" | awk '{print $1}') echo $CID echo '>>> Stopping and deleting old container' if [ "$CID" != "" ]; then sudo docker stop $CID sudo docker rm $CID fi echo '>>> Starting n...
Check the string "Image is up to date" to know whether the local image was updated:sudo docker pull my-example-registry.com:5050/web-client:latest | grep "Image is up to date" || (echo Already up to date. Exiting... && exit 0)So change your script to:#!/usr/bin/env bash set -e sudo docker pull my-example-regist...
RUN Powershell Script in Docker Container From Host Powershell Script
I have a powershell script in host which copy some files and starts the container.#Copy File docker cp "D:\addApplication.ps1" website:/inetpub/wwwroot/ #Start Container docker start website Write-Host 'Process has started' #Execute Container docker exec -ti website powershell #Run Script Invoke-Expression "C:\inetp...
Do not use the-tiflags to start an interactive session, just execute the script directly via thedocker execcommanddocker exec website powershell -command "C:\inetpub\wwwroot\addApplication.ps1"
AWS Fargate - Volumes
I am having a problem with my docker compose file: This is my docker compose file:version: '3' services: nginx-proxy: image: xxxxx.dkr.ecr.xxxxx.amazonaws.com/xxxx:latest container_name: "nginx-proxy" restart: always ports: - "80:80" - "443:443" volumes: - /var/run/docker.sock:/...
Does anyone know which variable name I need to use on my docker composer file?Fargate does not allow you to specify thehostorsourcePathfor a bind mount. You cancheck the docs for bind volumesandthe overview for Fargate task storage docsto learn more.The big premise of Fargate is it obfuscates the underlying host from t...
How to use STS headers with Traefik when using Docker
This is an issue I have been fighting with for days, but I could not find any help on stackoverflow, not even close to it. I hope to help people with similar issues in the future. Any elaboration on this question/answer is very much welcome.I have been trying to setSTS-headersto http-requests when usingTraefikas a prox...
I have been fighting with HSTS headers in Traefik for multiple days, when I learned something important about HSTS:Your browser will ignore any STS headers when the certificate you are using is considered not trustworthy/safe by your browser. You can verify this (in Chrome) with the security tab in the developer tools....
Deploy shiny app in rocker/shiny docker
Well, I'm new atDockerand I need to implement a Shiny app in a Docker Container.I have the image fromhttps://hub.docker.com/r/rocker/shiny/, that includesShiny Server, but I don't know how to deploy my app in the server.I want to deploy the app in the server, install the required packages for my app into the Docker, sa...
The link(https://hub.docker.com/r/rocker/shiny/) covers how to deploy the shiny server. Simplest way would be: docker run --rm -p 3838:3838 rocker/shinyIf you want to extend shiny server, you can write your own Dockerfile and start with shiny image as base image.(https://docs.docker.com/engine/reference/builder/)Docke...
Running linux container on docker windows
I installed Docker for windows on a windows 10 box. It required me to enable the HyperV feature on it. Everything installed correctly and is running fine.Although one thing took me by surprise. I am actually able to run a linux container on docker windows. I thought cross-containerization is not possible conceptually. ...
HyperV is used to spin up a Linux VM to run containers. Docker is still running Linux containers under the covers, the native Windows containers are still being developed.
Setting boolean value in docker-compose.yaml using environment variable
As docker documentationsuggestsboolean values in a docker-compose file should be enclosed in single quotes to avoid misinterpretation by the YAML parser. I have docker-compose file that populates some of the values with environment variables of the shell where it gets invokedmyservice: environment: - firstvar: ${...
I believe you've mixed up syntax, try:environment: - booleanvar=${MY_BOOLEAN_VAL}orenvironment: booleanvar: ${MY_BOOLEAN_VAL}
dial tcp lookup: no such host issue on docker windows desktop
I've installed docker on my office windows 10 Pro machine. I'm facing dial tcp lookup issue while trying to pull from the registry.Error response from daemon: Gethttps://registry-1.docker.io/v2/: dial tcp: lookup registry-1.docker.io on 192.168.65.1:53: no such hostI've tried many possible solutions from online. But I ...
I got the same issue and the below settings worked for me.setproxy addressas below in docker settings -username:password@proxyAddress:portEg:and also I set DNS server as automatic and it is not set to8.8.8.8
How to copy multiple files into a docker data volume
It may sound trivial but I couldn't find a easy way to copy multiple files into the root folder of a docker volume. I am using UbuntuXenial 16.04andDocker 1.12.1. For example if I have an Ubuntu container with the volume/my_data:docker run --name my_container -v /my_data -d ubuntu:latestIn my host machine I have a fold...
Actually it was easier than I though, just need to add a dot in the host path and it will work as expected, copying all files and folders within/my_datafolderdocker cp /tmp/my_data/. my_container:/my_data
Testing connection to docker daemon
I am writing a script that will boot docker-compose automatically.However, sometimes, doingeval "$(docker-machine env default)"doesn't cause the docker daemon to be connected immediatly and when the next line comes (docker-compose up) I getCannot connect to the Docker daemon. Is the docker daemon running on this host?I...
TheDocker Remote APIhas aPING endpoint. You can use the endpoint to check whether you can successfully connect to the Docker daemon.docker-machine envsets the environment variableDOCKER_HOST, so you can useDOCKER_HOSTas host to ping. Usingnc, you can ping the host as follows:$ eval "$(docker-machine env default)" $ ech...
Docker doesn't create directory during build
Experimenting with Docker for the first time. Have these steps in my Dockerfile to create a directory, but when I run the container, the directory isn't there.FROM ubuntu MAINTAINER AfterWorkGuinness RUN apt-get update RUN apt-get install -y openssh-server RUN mkdir /root/.ssh RUN cd /root/.ssh RUN ssh-keygen -t rsa -N...
Use a namedvolumeinstead of abind mount,docker run -v tmphome:/root whateverIn a named volume the files will still persist over container restarts but the contents from the directorywill be copied to the mounted volume at creation time. Docker chooses where to store the data depending on the driver in use.localis the d...
Incorrect UTC date in MongoDB Compass
I package my python (flask) application with docker. Within my app I'm generating UTC date withdatetimelibrary usingdatetime.utcnow().Unfortunately, when I inspect saved data withMongoDB Compassthe UTC date is offset two hours (to my local time zone). All my docker containers have time zone set toEtc/UTC. Morover,mongo...
Finally, after trying to prove myself wrong, and hairless head I found the cause and solution for my problem.We are living in the world of illusionandwhat you see is not what you get!!!. I decided to inspect my data overmongo shellclient rather thanMongoDB Compass GUI. I figure out that data that arrived to database co...
Integrating Docker-Machine with Amazon EC2
I am reading this article which shows me how I can configure my docker VM on top of amazon ec2https://docs.docker.com/machine/drivers/aws/I got to the stepdocker-machine create --driver amazonec2 aws01but now I get an errorError with pre-create check: "unable to find a subnet in the zone: us-east-1a"I googled and found...
I solved it myself. putting the answer herefirst doaws configureThis will ask you some questions like security id and key. you should be able to get this information from the aws dashboard.aws ec2 describe-subnetsThis will list a bunch of subnet information. Just look at the first one and make note of AvailabilityZone ...
multiple docker clients on the same machine
As I'm working with docker and docker-machine a lot, I have to work with several docker versions at the same time. And we all know how hard this can be:$ docker ps Error response from daemon: client is newer than server (client API version: 1.23, server API version: 1.22)So, my question: (How) is it possible to run mu...
I found a solution for me:mkdir /opt/docker && cd /opt/docker wget https://get.docker.com/builds/Linux/i386/docker-1.11.2.tgz wget https://get.docker.com/builds/Linux/i386/docker-1.11.0.tgz wget https://get.docker.com/builds/Linux/i386/docker-1.10.0.tgz # versions you want tar -xzf docker-1.11.2.tgz -C 1.11.2 tar -xzf ...
Why is the Docker service stopping?
I'm running Ubuntu as a subsystem on Windows 10.I have just followed the steps to install Docker on Linux:https://docs.docker.com/install/linux/docker-ce/ubuntu/And are now at the step to test the hello-world app:$ sudo docker run hello-worldWhere I get this error:docker: Cannot connect to the Docker daemon at unix:///...
What you got is as expected.Microsoft does not support running the Docker daemon (also known as the service) within the WSL instance. You can refer tothis discussion.What you can do is just usedocker clientin WSL to connect to a remote docker engine which meansdocker daemonstill on other PC.But, if you useWSL2which ann...
Docker - one process per container?
I sometimes use Docker for my development work. When I do, I usually work on an out-of-the-box LAMP image fromtutum.My question is: Doesn't it defeat the purpose to work with Docker if it runs multiple processes in one container? (like the container started off Tutum's LAMP image) Isn't the whole idea of Docker to sepa...
Generally sometimes it is neccessary or more useful to use one container for more than one process like in this situation.Such situation happens when processes are used together to fulfill its task. I can imagine for example situation when somebody want to add logging to the web application by using ELK (Elasticsearch,...
couldn't start Celery with docker-compose
I have Flask app with Celery worker and Redis and it's working normally as expected when running on local machine. Then I tried to Dockerize the application. When I trying to build/start the services ( ie, flask app, Celery, and Redis) usingsudo docker-compose upall services are running except Celery and showing an err...
First of all the celery image is deprecated in favour of standard python image more infohere.WORKDIRsets the working directory for all the command after it is defined in the Dockerfile, which means the command which you are try to run will run from that directory. Docker image for celery sets the working directory to/h...
Mysql client called with `docker-compose run` vs. `docker-compose exec`
Why do you need to specify a host when calling withdocker-compose run?e.g.docker-compose run db_container mysql -uuser -ppass db_name -h db_containerseems to be the direct equivalent ofdocker-compose exec db_container mysql -uuser -ppass db_nameWhen omitting the hostname flag from the first example, mysql fails with a ...
docker-compose run will start a new container on the same network with a name likefolder_db_container_run_1. This is not running mysql since you passed it a command. So it is running that command. So you connect from this container to the original db containerdocker-compose run db_container mysql -uuser -ppass db_name ...
Create AWS Batch Managed Compute Environment passing UserData to Container Instances
I would like to create aManaged Compute EnvironmentforAWS Batch, but useEC2 User Datato configure the instances as they are brought into the ECS fleet that Batch is scheduling jobs onto.It shouldn't matter, but the purpose of the User Data script is to pull down large data files onto an InstanceStore that the Docker co...
You can create an AMI based on the AWS provided AMI, and customize it. It will still be managed since the Batch and/or ECS daemon is running on it.As a side note I’m trying to do the same thing but no luck so far. I may end up creating a custom AMI and include the configure script in the AMI itself in /etc/rc.local. No...
Docker compose with multiple databases in one container
I want to create Docker container and import 3 databases into it. I've tried with the following code:version: '3.3' services: web: build: context: ./php56 dockerfile: Dockerfile container_name: php56 depends_on: - db volumes: - ../www:/var/www/html/ ports: - 8000:80 ...
Instead of creating additional databases in docker-compose file, just create them in SQL files instead:version: '3.3' services: web: build: context: ./php56 dockerfile: Dockerfile container_name: php56 depends_on: - db volumes: - ../www:/var/www/html/ ports: - 8000:80...
Docker compose fails with "failed to read dockerfile: open /var/lib/docker/tmp/buildkit-mount[...]/Dockerfile: no such file or directory"
On Windows 11, with this rather simpledocker-compose.yamlfileversion: '3.0' services: php-apache-environment: container_name: php-apache build: ./php volumes: - ./php/src:/var/www/html/ ports: - 8000:80 db: image: mysql:5.6.27 restart: always environment: MYSQL_ROOT_PA...
I can definitely reproduce this having a an emptyphpfolder, so missing theDockerfile, with the following minimal example.File hierarchy:. ├── docker-compose.yml └── php ## ^-- mind this is an empty folder, not a fileAnd the minimaldocker-compose.yml:version: "3.9" services: php-apache-environment: container_name...
AWS Elastic Beanstalk EFS Mount Error: unknown filesystem type 'efs'
I am trying to mount my EFS to a multi-docker Elastic Beanstalk environment using task definition with Dockerrun.aws.json. Also, I have configured the security group of EFS to accept NFS traffic from EC2 (EB environment) security group.However, I am facing with the error:ECS task stopped due to: Error response from dae...
After searching the entire web, I didn't encounter any solution for this problem. I contacted with AWS Support. They told me that the issue is with missing "amazon-efs-utils" extension on EC2 instances created by Elastic Beanstalk and then I fixed the error by creating a file named efs.config inside .ebextensions folde...
Installing Office into Windows Container (servercore:ltsc2019) failed with error code 17002
Error MessageODT (Office Deployment Tool) log reported error when installing into Windows Container (Server Core): C2R client returned failing error code, error code: 17002EnvironmentsBehavior in Windows Server 2019 (1809) with Desktop Experience installed.ODT installation Result: Succeeded.test-o365.ps1: Succeeded.Beh...
I've been struggling with this for a while, and finally got it to work. I found the solution to the 17002 error was to run the setup.exe /configure config.xml while running the docker image interactively, and then committing that container. This worked for me on the windows:1809 image.Full writeupI'm copying the downlo...
docker is using the v1 registry api when it should use v2
I'm trying to use a self hosted docker registry v2. I should be able to push a docker image, which does work locally on the host server (coreos) running the registry v2 container. However, on a separate machine (also coreos, same version) when I try to push to the registry, it's try to push to v1, giving this error:E...
You need to secure the registry before you can access it remotely, or explicitly allow all your Docker daemons to access insecure registries.To secure the registry the easiest choice is to buy an SSL certificate for your server, but you can also self-sign the certificate and distribute to clients.To allow insecure acce...
Docker Compose w/ Gulp - Local gulp not found
I am attempting to use gulp inside a Docker container.I have the followingDockerfileFROM golang:alpine RUN apk --update add --no-cache git nodejs RUN npm install --global gulp ENV GOPATH=/go PATH=$PATH:/go/bin VOLUME ["/go/src/github.com/me/sandbox", "/go/pkg","/go/bin"] WORKDIR /go/src/github.com/me/sandbox CMD ["gulp...
You need a local version of gulp as well as a global one.Adding this line should fix your issueRUN npm i gulp
Networking with Docker on Windows
I used this official guide to set up Docker on a Windows 7 machine:https://docs.docker.com/windows/started/I successfully pulled an image from the docker hub and I can run my own docker image.No I am stuck trying to run and access a webserver with docker on Windows. Apparently, behindboot2dockerI can't reach my docker ...
Things changed a little with the introduction of Docker Toolbox. Now you do not directly interact withboot2docker, but instead usedocker-machine. Althoughboot2dockerstill exists as VM there is no CLI-Tool any longer. It was replaced by Docker Machine.Thus you should be able to get hold of the VM's IP address by typing:...
Docker dpage/pgadmin4 error: specified user does not exist
This is thedocker-compose.ymlfile:version: '3' services: ############################ # Setup database container # ############################ postgres_db: image: postgres restart: always ports: - ${POSTGRES_PORT}:${POSTGRES_PORT} environment: - POSTGRES_USER=${POSTGRES_USER} - PO...
Addtty: trueto thepgadminservice in the docker-compose.yml file.pgadmin: image: dpage/pgadmin4:4.19 restart: always ports: - 8001:8080/tcp environment: - PGADMIN_LISTEN_ADDRESS=0.0.0.0 - PGADMIN_LISTEN_PORT=8080 - PGADMIN_DEFAULT_EMAIL=${PGADMIN_DEFAULT_EMAIL} - PGADMIN_DE...
.Net resource with files content make docker build fail
"dotnet build" builds a project with no errors, and at the same time docker build gives following error:/src/Audit.Worker/Example/Resources.resx : error MSB3103: Invalid Resx file. System.IO.DirectoryNotFoundException: Could not find a part of the path '/src/Audit.Worker/Example/data/example.yaml'. [/src/Audit.Worker/A...
Eventually, I figured out what was the reason.Visual Studio resources tool (I assume it responsible for .resx file content generation) makes an assumption that file paths are case insensitive and generates all file paths in lower case (i.e.data\example.yaml). At the same time base docker image used for the build is bas...
Docker Python script can't find file
I've successfully built a Docker container and copied my application's files into the container in the Dockerfile. However, I am trying to execute a Python script that references an input file (that was copied into the container during the Docker build). I can't seem to figure out why my script is telling me it cannot ...
There are two issues I've identified so far. Maya G points out a third in the comments below.Incorrect conditional logicYou need to replace:if len(sys.argv) >= 2: sys.exit('ERROR: Received 2 or more arguments. Expected 1: Input file name')With:if len(sys.argv) > 2: sys.exit('ERROR: Received more than two argume...
Short lived kubernetes container (/sidekick) in a pod (in a Replication Controller)
I have a ReplicationController containing two containers in a pod, the first is a long-living pod, the second does a few maintenance tasks when the RC starts up a POD. However as the second container is short lived, it stops itself when it finishes its start tasks. When Kuberbetes notices this, it kills off the POD an...
As you already noticed, by design all containers in a pod are destined to live and die together. It's a bit hard to tell what your best alternative would be without knowing what kind of maintenance task your sidekick needs to perform exactly. Generally speaking, I can think of three approaches:Keep your maintenance con...
Docker run returns an exception: Application has been compiled by a more recent version of the Java Runtime
I created a web application using Springboot and now I'm going to dockerize it and upload it into docker hub. So myDockerfileis,FROM openjdk:8 EXPOSE 8080 ADD target/spring-boot-web-0.0.1-SNAPSHOT.jar spring-boot-web-0.0.1-SNAPSHOT.jar ENTRYPOINT ["java","-jar","spring-boot-web-0.0.1-SNAPSHOT.jar"]After creating.jar...
Your application shouldnt run either way because of thisdocker run -it -p 4000:80 kubernatesimageit should bedocker run -it -p 4000:8080 kubernatesimageNow concerning the issue : Your runtime version is 8 : because of your dockerfile is "FROM openjdk:8" so your application will be running in java 8 environment =>v...
Difference between --cache-to/from and --mount type=cache in docker buildx build
According to the officialdocumentation, in order to leverage a cache backend indocker buildx build, you need to use the--cache-from/toflags.This makes sense as intuitively it signifies the place where the build result will be cached to (--cache-to) and what cache it will use to speed up the build process (--cache-from)...
They are solving two different problems.--cache-to/fromis used to store the result of a build step and reuse it in future builds, avoiding the need to run the command again. This is stored in a persistent location outside of the builder, like on a registry, so that other builders can skip already completed steps of a b...
Enable mysqli in docker container
I build some containers with the following code:version: '3' services: db: image: mysql:5.7 environment: MYSQL_ROOT_PASSWORD: test MYSQL_DATABASE: test MYSQL_USER: test MYSQL_PASSWORD: test ports: - "9906:3306" web: image: php:7.3-apache container_name: php_web ...
Do this in your Dockerfile to enable MySQLi:RUN docker-php-ext-install mysqli && docker-php-ext-enable mysqli