Prompt stringlengths 14 160 | Instruction stringlengths 18 2k | Response stringlengths 8 2k |
|---|---|---|
Open CV error failed to init raw1394 persisting in docker | I am running ubuntu 14.04 in a docker container and have opencv installed. Every time it runs I recieve the following error as described here:OpenCV: libdc1394 error: Failed to initialize libdc1394. The technique of linking /dev/null to the device file seems to work, but it is not persistent in the docker container, an... | Runningln /dev/null /dev/raw1394inside the Dockerfile won't help you because/devis not part of the docker image. You can get around this by adding avolume mount. An exampleDockerfileanddocker-compose.ymlwould look like this:[fedora@myhost ~]$ cat Dockerfile
FROM ubuntu:14.04
RUN apt-get update && \
apt-get install... |
How to run 2 different commands from docker-compose command: | I want to run 2 different commands for my service from docker-compose.bash script.shconfig /etc/config.yamlCurrently, my docker-compose looks like the below. I want the bash script to run after the config commanddocker-compose.yaml:services:
API:
build: .
ports:
- 8080:8080
enviro... | Write a new entrypoint script.#!/bin/bash
/bin/api "$@"
# perhaps
source /script.sh
# or exec
exec /script.shCopy this into your image on build.COPY --chmod=755 entrypoint.sh /
ENTRYPOINT ["/entrypoint.sh"]This will result in the arguments you are passing in your compose file to be passed to /bin/api, and after that... |
Docker tmux issue | I installed Parrot OS as a docker container and when I run tmux in it, theprompt stringchanges. It acts like an eyesore to an OCD person. I don't really know what the issue could be called exactly so can't mention the term, sorry for that.In the image, they are two different containers of Parrot OS, with tmux running i... | This is because tmux is not aware that your terminal support UTF-8. Either:Add the-uflag to tmux (tmux -u newortmux -u attach); orMake sure your system is in a UTF-8 locale and the environment variables are set correctly (LANG,LC_ALLand so on). |
Could not locate a Flask application when creating a Docker Image | I hope someone can help me with this. The following error code comes up when I try and run docker run todolist-docker.WARNING: This is a development server. Do not use it in a production deployment.
Use a production WSGI server instead.
* Debug mode: off
Error: Could not locate a Flask application. You did not pro... | Is FLASK_APP defined in the docker container? There's no ENV statement in the Dockerfile, and you didn't mention using docker's -e or --env command option. Your container won't inherit your environment variables from the hosting environment.# syntax=docker/dockerfile:1
FROM python:3.7.8
WORKDIR /tododocker
COPY re... |
App running in Docker container on port 4567 can't be accessed from the outside | Updating the post with all files required to recreate the setup. – Still the same problem. Not able to access service running in container.FROM python:3
RUN apt-get update
RUN apt-get install -y ruby rubygems
RUN gem install sinatra
WORKDIR /app
ADD . /app/
EXPOSE 4567
CMD ruby hei.rb -p 4567hei.rbrequire 'sinatra'
... | Sinatra was binding to the wrong interface.
Fixed by adding the-oswitch.CMD ruby hei.rb -p 4567 -o 0.0.0.0 |
This site can’t be reached docker-compose | I am trying to use docker-compose forreact-typescriptapplication withwebpack-dev-serverbelow is myDockerfileFROM node:lts-slim
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
EXPOSE 3000
CMD [ "npm", "start" ]"start": "webpack-dev-server --port 3000"thispackage.jsonlinedocker-compose.ymlversion: "3"
services:
fr... | Try changing yourstartscript to:webpack-dev-server --host 0.0.0.0 --port 3000And your Dockerfile to:FROM node:lts-slim
RUN mkdir -p /usr/src/app
WORKDIR /usr/src/app
COPY . /usr/src/app/
EXPOSE 3000
CMD [ "npm", "start" ]Note: I highly advise against running your containers as root. You should always downgrade your... |
Unable to use mcr.microsoft.com/windows/servercore:ltsc when building from azure cloudshell (powershell) | This works perfectly when I build locally, but to avoid having to move images to the azure container registry I am trying to build in the cloud.Dockerfile contains:FROM mcr.microsoft.com/windows/servercore:ltsc AS build-stage1
SHELL ["powershell", "-Command", "$ErrorActionPreference = 'Stop'; $ProgressPreference = 'Si... | I'm not clear how do you build the image successfully. But I recommend you take a look at the imagemcr.microsoft.com/windows/servercorein the docker hub. And it also gives out the available tagshere. There is no tag asltsc. You need to choose one in the available tags. For example,mcr.microsoft.com/windows/servercore:l... |
Stop VM with MongoDB docker image without losing data | I have installed the official MongoDB docker image in a VM on AWS EC2, and the database has already data on it. If I stop the VM (to save expenses overnight), will I lose all the data contained in the database? How can I make it persistent in those scenarios? | There are multiple options to achieve this but the 2 most common ways are:Create a directory on your host to mount the dataCreate a docker
volume to mount the data1) Create a data directory on a suitable volume on your host system, e.g./my/own/datadir. Start your mongo container like this:$ docker run --name some-mongo... |
(Windows Git-bash) IntelliJ git bash shell color scheme messed up with Docker | (Windows Git-bash) When I use git bash for terminal in a project for IntelliJ I have problems when I log into a docker container and usels. Text gets highlighted light blue and the color doesn't go away until I exit.Any thought on how to correct this? I suspect this comes from IntelliJ's recoloring of the shell colors.... | The solution appears to have been to restore the shell colors to default, and restart all the relevant services. Because I am unsure as to what was preventing the default colors to fix the problem, the solution may require an OS reboot. |
Which docker image is the official MySQL image? | I am trying to install MySQL in Docker.When I searched for a MySQL image in Docker Hub, it gave memysql. Which says it is "official" release.But when I went to the MySQL website,it saysthatmysql/mysql-serveris the official image.I am a bit confused which is the official and which one I should use. Of course Icanuse eit... | mysqlis officially supported by Docker.mysql/mysql-serveris officially supported by MySQL.It is your choice which organization you want to rely on for updates, support, etc. |
Log doesn't save to file in docker environment | In my production environmentproduction.rb. I have configured my log will be saved to file:config.logger = Logger.new('log/production.log')When I run locally (start server by using command linerails s -e production). everything works fine. But when I run on docker environment, I don't seeproduction.logprinted out.Please... | I don't see production.log printed out.Where are you looking? On your host or in the docker container that you are running?By default, the file will be created in your container filesystem.If you want it directly visible from your host (which runs the docker daemon), you would need tomount an host directory as a data v... |
Building quarkus native Linux/amd64 (x86_64) image from Apple M1 (Arm) | I am trying to build Quarkus 2.8.0 for x86 platfom of native docker container from Apple M1 Macbook and deploy it in Linux amd64 Portainer. I was able to build the native image and when checking the filefile target/simple-app-1.0.0-SNAPSHOT-runnerthe output is:target/simple-app-1.0.0-SNAPSHOT-runner: Mach-O 64-bit exec... | First, you need to build an executable file for the x86_64 (for that use an image with graalvm or mandrel for x86_64):./mvnw clean package -Dnative -Dquarkus.native.container-build=true -Dquarkus.native.builder-image=quay.io/quarkus/ubi-quarkus-graalvmce-builder-image:22.3.2-java17-amd64 -DskipTestsSecond, you need to ... |
Create Dockerfile that includes Firefox and Chrome drivers for Selenium | I have the following Dockerfile which will build a Selenium serverFROM selenium/standalone-firefox:3.4.0-chromium
FROM selenium/standalone-chrome
USER root
ENV NODE_ENV test
RUN mkdir -p /usr/local/cdt-tests/csv-data
COPY ./csv-data /usr/local/cdt-tests/csv-data
USER seluserobviously the two FROM statements is incorr... | There is no inheritance type setup for Dockerfiles like you are suggesting.To implement a combined build you would need find the commonFROMancestor of thestandalone-firefoxandstandalone-chrome, which isselenium/node-baseand create your own Docker file to reapply all the build steps thatselenium/standalone-chromeapplies... |
/bin/sh: 1: gvm: not found | Problem:I'm attempting to create a Dockerfile that installs all the components to run Go, to installGVM (Go Version Management), and to install specific Go Versions.Error:When I try building the container with:docker build -t ##### .I get this error:/bin/sh: 1: gvm: not foundThe command '/bin/sh -c gvm install go1.4 -B... | Your shell is/bin/sh, butgvmputs its initialization in~/.bashrc, and expects/bin/bash.You need to source thegvminitialization scripts to run the commands from a non-interactive bash shell:RUN ["/bin/bash", "-c", ". /root/.gvm/scripts/gvm && gvm install go1.4 -B"]
RUN ["/bin/bash", "-c", ". /root/.gvm/scripts/gvm && gvm... |
Rancher external subdomains | I need to set subdomains for apps in docker containers, not in internal rancher network but for public use. I have domain delegated to rancher server. And there is host property in almost all stacks from catalog, but it doesn't work. I guess i need to delegate domain using some rancher dns or setup nginx to proxy traff... | What you need is add a load-balancer service, which then forwards 80/443 of the host to the container app/nginx/whatever.So navigate to your stack, click on add service -> load balancer. Then you can chose either for wich domain to trigger ( or catch all, which i would do for now ) and then which target. There you sele... |
How to inherit/merge volumes from yaml anchors in docker-compose? | I want mydocker-composefile to merge (reuse) volumes definitions, as follows:x-defaults: &my-defaults:
volumes:
- /first:/volume
- /second:/volume
services:
my-service1:
<<: *my-defaults
volumes:
- /additional:/volume
my-service2:
<<: *my-defaults
volumes:
- /custom:/volRe... | Simple answer: it's not possible. Array lists are replaced on inheritance, thus when overriding, have to repeat all list statements. |
Use Spring Boot Actuator in Docker? | I have got a Spring Boot Microservice with custom Spring Boot Acturators. When i run the Jar directly i can access all of my Acturators, when i run the same Jar inside a Docker-Image i get a 404 Error.SecurityConfig:@Configuration
public class ActuatorSecurityConfiguration extends WebSecurityConfigurerAdapter {
@O... | TL;DRi forgot to change/add the actuator spring profileLong VersionThe problem was inside my Dockerfile:FROM openjdk:8-jdk-alpine
ADD target/app.jar /jar/
VOLUME /tmp
EXPOSE 8080
ENV SPRINGPROFILES=prod
CMD ["java", "-Djava.security.egd=file:/dev/./urandom", "-jar", "-Dserver.port=8080", "-Dserver.address=0.0.0.0"... |
Docker image of 32 bit Ubuntu | I am looking a lightweight docker image with Ubuntu 32 bit. Where can I find it?When I put a commanddocker build .in my directory with Dockerfile I get output like:ending build context to Docker daemon 10.21 MB
Step 1 : FROM ubuntu
---> 104bec311bcd
Step 2 : ENV x /home/
---> Using cache
---> e38b022c91f8
Step... | You can find in the Docker Hub various 32 bits docker images, for examplehttps://hub.docker.com/r/32bit/ubuntu/You can learn how to do it yourself withhttp://mwhiteley.com/linux-containers/2013/08/31/docker-on-i386.htmlAbout the hashes, you should readhttps://docs.docker.com/engine/userguide/storagedriver/imagesandcont... |
Cassandra in Docker cant connect from outside | Hi I am new to word Docker and Cassandar. I have a problem connecting to Cassandra in Docker from my computer.I run container Cassandra and I see that exposed ips and ports are 192.168.99.100:9042.(first image) In docker I can even see that "Test cluster" is running but when I want to connect to Cassandra by NoSQL Mana... | you don't expose a port. 9042 is docker port.
When you run the docker image you must remember this:docker run -p 9042:9042 image-namefirst 9042 define the port number where outer world will connect and 2nd 9042 defines docker's port number which will be bound with outer port number 9042. |
Error loading psycopg2 module when installed from a 'wheel' | I am trying to install some python requirements from a local package directory containingwheelarchives. I am installing the requirements inside a Docker container.The steps I'm following are:$ pip install wheel
# wheel runs, outputs .whl files to wheelhouse directory
$ pip wheel --wheel-dir wheelhouse -r requirements.t... | I don't know what a wheel or a docker is, but your error comes from a mismatch between the Python used to build the module and the one that is trying to run it. |
Different home directory during Docker build in Docker hub | I have found a strange difference between building docker images in my Ubuntu 14.04 host machine and the Docker Hub automated builds.This is my Dockerfile:FROM buildpack-deps:wheezy-scm
RUN echo $HOMEThis is the output in my machine:---> 2afbec25f6f6
Step 1 : RUN echo $HOME
---> Running in 6074455e13c0
/
---> 0cb1b61... | Effectively there were a change in$HOME, and the changes were merged after Docker releasev1.0. I have built the Dockerfile you provided and it shows me$HOME=/root(I use Dockerv1.5.0). CheckDocker Issue #2968and related commits for additional details. |
Docker volume does not persist data | Here is my docker file:FROM ubuntu:14.04
RUN apt-key adv --keyserver keyserver.ubuntu.com --recv-keys B97B0AFCAA1A47F044F244A07FCC7D46ACCC4CF8
RUN echo "deb http://apt.postgresql.org/pub/repos/apt/ precise-pgdg main" > /etc/apt/sources.list.d/pgdg.list
RUN apt-get update && apt-get -y -q install python-software-prope... | Based on your comment:the data persisted, but I still can't find the persist data in my host ./data directoryand running this command:docker run -i -t -v="data:/data" -p 5432:5432 my_image/postgresql:9.3You appear to be confusing a named volume and a host volume. The named volume is used when you give the volume a name... |
docker container exited immediately after python script execution | docker container exited immediately after python script execution:docker run -t -i -v /root/test.py:/test.py zookeeper python test.py
(test.py starts zookeeper service )The command is successful but exits immediately with out starting container. I could NOT start the container with "docker start container id".Manually ... | Just starting the server is not enough. When the CMD exits, so does the container. Thus, if you start a service that's a daemon, you need to keep your process alive. This can be achieved by, for example, tailing the service log file. supervisord is another way to run processes and keep the CMD alive.For example, yo... |
Windows - Docker CMD does not execute | For the life of me, I cannot seem to get my provisioning script to execute when I run my container. Down the road, I will need to pass in arguments to the docker run command to replace 'hiiii' and '123' for multiple container deployments.This is my docker fileFROM microsoft/aspnet:3.5-windowsservercore-10.0.14393.1198
... | I was able to get it working the way I had hoped. Though I am still working out some details in the provisioning script, this is how I ended up getting the result I wanted from the docker side of things.FROM microsoft/aspnet:3.5-windowsservercore-10.0.14393.1198
#The shell line needs to be removed and any RUN commands... |
Tag a docker container? | I have the following scenario:Continuous Delivery with DockerBuild Image from GitHub repositoryStop the current running containerStart the current running container with the newer imageFor stopping the container, I need the container ID.
Can I assign a reusable tag to a container once I start it, so I know which conta... | docker run --name "ContainerID" ..... Seeherefor more details |
Docker building fails randomly with Error mounting | Every time I try building with docker or fig an image (doesn't matter which one), I randomly will getCannot start container : Error getting container from driver devicemapper: Error mounting '/dev/mapper/docker-8:1-262151-' on '/var/lib/docker/devicemapper/mnt/': no such file or directoryWeird thing is, if I re-run it... | Switching to aufs storage seemed to resolve it.I used a base image box fromphusionwhich seems to optimize for docker. |
How JVM -XX:MaxRAM option can be correctly used? [duplicate] | This question already has answers here:Setting -XX:MaxRam(3 answers)Closed3 years ago.I run a java application with the following parameters:#!/bin/bash
export JVM_OPTS="-XX:MaxRAM=150m"
export JVM_OPTS="$JVM_OPTS -XX:+UseSerialGC"
java $JVM_OPTS -jar application.jarThehtopshows:VIRT=475MRES=238MSHR=4880MEM%=24.1As I... | -XX:MaxRAMoption affects nothing but thedefault heap size.Memory used by a Java process (from the OS perspective) includes not only Java heap, but also many other things. Seethis answerfor details. |
Docker COPY no such file or directory | Building docker image fails on copy task. No such file or directory. I am using the hello worldexample from springBuilding from openjdk:8-jdk-alpineRun echo ${PWD}prints /Run lsprints a set of normal directories (/usr /var etc) but no project files are presentWhy is docker not using the WORKING directory?FROM openjdk:8... | You're getting a "no such file or directory" error, and it looks like that's the truth.The Dockerfile sets:ARG DEPENDENCY=target/dependencyAnd then attempts aCOPYoperation:COPY ${DEPENDENCY}/BOOT-INF/lib /app/libIf you resolve${DEPENDENCY}, thatCOPYcommand look like:COPY target/dependency/BOOT-INF/lib /app/libAnd there... |
PHP Docker container exits for no reason | I'm relatively new to docker and docker-compose so I made this fileversion: '3'
services:
web:
image: nginx:latest
ports:
- "8050:80"
volumes:
- ./code:/code
- ./site.conf:/etc/nginx/conf.d/default.conf
links:
- php
php:
image: php:7.3-fpm-alpine3.9
command: apk --upd... | This is because you are telling the container to run the apk update command when it starts, this completes and exits with a valid exit code 0...To get it to run that apk update command and still use the php container, you need to extend the php image with your own build to create your own 'custom image' of the base php... |
Can't run dmidecode on docker container | I am trying to run command dmidecode in my docker container,docker run --device /dev/mem:/dev/mem -it jin/ubu1604However, it claims that there is no permissionroot@bd1062dfd8ab:/# dmidecode
# dmidecode 3.0
Scanning /dev/mem for entry point.
/dev/mem: Operation not permitted
root@bd1062dfd8ab:/# ls -l /dev
total 0
crw--... | Docker provides an isolation layer, and one of the majorgoalsof Docker is to hide details of the host's hardware from containers. The easiest, most appropriate way to query low-level details of the host's hardware is from a root shell on the host, ignoring Docker entirely.The actual mechanism of this is by restricting... |
Does NVIDIA Docker need CUDA installed? [closed] | Closed.This question does not meetStack Overflow guidelines. It is not currently accepting answers.This question does not appear to be abouta specific programming problem, a software algorithm, or software tools primarily used by programmers. If you believe the question would be on-topic onanother Stack Exchange site, ... | You need:the nvidia drivera recent version of docker-ce (19.03 or newer)and thenvidia container toolkitalso called "nvidia docker"You generally do not need CUDA (toolkit) or CUDNN installed on the base machine. Those can be in the container for use in the container.Seeherefor specific install instructions. |
running apache in docker | Ok, I have exhausted pretty much all threads and articles, but still cant get my apache webserver to run in standalone mode on Centos Docker Container.Here is my simplified Dockerfile# install apache
RUN yum -y install httpd
# start the webserver
ADD startservice /startservice
RUN chmod 775 /startservice
EXPOSE 80
C... | This is a classic docker issue. The process you start must execute in the foreground, otherwise the container simply stops.So, to be able to do so the following can be used in your startservice script:#!/usr/bin/sh
service httpd start
# Tail the log file
tail -f /var/log/httpd/access_log
# Alternatively, you can tai... |
Can't connect python app container to local postgres | I'm trying to connect to postgres running locally through a python script that's running in a container. I'm setting it up like this because in the future once I deploy I'll be using a managed database service that spins up postgres.Ideally I'm able to define a postgres url in the.env, docker-compose uses the env to s... | Ok, so I'm using a mac as a development machine should have mentioned that, for people struggling with the same problem. mac's docker host IP is always changing.Changing my .env postgres url to:postgresql://username:[email protected]:5432/dbnameseems to do the trick. |
Containerising Python command line application | I have created a Python command line application that is available through PyPi /pip install.The application has native dependencies.To make the installation less painful for Windows users I would like to create a Dockerised version out of this command line application.What are the steps to convertsetup.pywith an entry... | Well, You have to create a Dockerfile and build an image off of it. There are best practices regarding the docker image creation that you need to apply. There are also language specific best practices.Just to give you some ideas about the process:FROM python:3.7.1-alpine3.8 #base image
ADD . /myapp # add project files
... |
Why a angular container needs a exposed port to connect? | this is just a question about theory, my app is running perfectly...So, I have 3 services runing with docker-compose: apostgres database, abackend springbootand afrontend angular.From what I know, docker containers can acess ports from other docker containers without the need to expose the port, so there is no need to ... | You Angular frontend is making requests to the Spring backend from outside the frontend container. It's making request from inside your browser. That's why the backend also needs to be exposed.Second, you don't needlinks. The linking will be done automatically since both services are in the same network.Here is a updat... |
Selenium Python: No such file or directory: '/usr/local/bin/chromedriver' but it exists and is added to path | Trying to run selenium python on a Docker Apline Linux and getting the "Message: 'chromedriver' executable needs to be in PATH" error because it thinks the file doesn't exist. But tried everything I can fine in other answers, but it still won't launch.Here's what I tried so far:Added it to folder to PATH and PYTHONPAT... | The output fromlddsuggests thatchromedriveris built againstglibc(GNU standard C library), which isn't compatible to vanilla Alpine, usingmusl libc.To fix this, try installing the Alpine compatible version ofchromedriver, available in Alpine repositories, usingapk add chromium-chromedriver:https://pkgs.alpinelinux.org/p... |
Mounting Windows drives to access from Docker | I am looking to use files on my Windows computer in a Docker container. Thisis explained here.My question relates to how to get to the Docker settings dialogue.I am using Docker Toolbox on Windows 10. When I right-click on the Docker icon from the task bar, I get three options:Docker Quick Start Terminal;Unpin from tas... | Docker toolbox would be using VirtualBox.The answer you are referring to is likely to useDocker for WindowswithHyper-V: see "Install Docker for Windows"Docker for Windows requires Microsoft Hyper-V to run. After Hyper-V is enabled, VirtualBox will no longer work, but any VirtualBox VM images will remain.VirtualBox VMs ... |
Dockerfile from python:3.6-slim add jdk8 | someone could help me, i'm starting from follow docker fileFROM python:3.6-slim
RUN apt-get update
RUN apt-get install -y apt-utils build-essential gccAnd i would add an openjdk 8thanks | You can download java tar.gz, unpack it and set environment variable.
Below a sample of implementation in Dockerfile:FROM python:3.6-slim
RUN apt-get update
RUN apt-get install -y apt-utils build-essential gcc
ENV JAVA_FOLDER java-se-8u41-ri
ENV JVM_ROOT /usr/lib/jvm
ENV JAVA_PKG_NAME openjdk-8u41-b04-linux-x64-14_... |
Gitlab runner not executing jobs docker image | I created a minimal gitlab CI script to verify this error:docker_execution_test:
image: debian:9
script:
- pwd
- lsThe output I would expect is this:db@theia:~/git/docker_test (master*)$ docker run -it --rm debian:9 pwd
/
db@theia:~/git/docker_test (master*)$ docker run -it --rm debian:9 ls
bin dev home... | As it turns out, gitlab-runner was working as expected. What is quite confusing though is that it does some manipulations to the image it's booting up.
The entrypoint is overridden and the folder the repository is checked out into is mounted into the container with the WORKDIR pointing to it.So while it is possible to ... |
Docker and BrowserSync | I'm trying to run browsersync in my docker container but I only get the directory listing when I navigate to localhost:3000. I'm trying to run a WordPress instance, and I'm using Gulp as the task runner. localhost:3001 brings up the browsersync ui successfully and viewing localhost (no port) brings up the homepage. Her... | Added a proxy option and now it works @ localhost:3000const gBrowsersync = function(done) {
browsersync.init({
open: false,
proxy: "localhost"
});
done();
};Not sure why I had to add localhost as a proxy though. If anyone can provide a brief explanation, I would appreciate it. |
Pass argument to python script running in a docker container | Suppose the following setup:Website written in php / laravelUser uploads a file (either text / doc / pdf)We have a docker container which contains a python script for converting text into a numpy array.I want to take this uploaded data and pass it to the python script.I can't find anything which explains how to pass dy... | ... a python script for ...Just run it; don't package it into a Docker container. That's doubly true if its inputs and outputs are both local files, and it expects to do its thing and exit promptly: the filesystem isolation Docker provides works against you here.This is, of course, technically possible. Depending on ... |
Setting up the network for Kubernetes | I'm reading theKubernetes "Getting Started from Scratch" Guideand have arrived at the dreadedNetwork Section, where they state:Kubernetes imposes the following fundamental requirements on any networking implementation
(barring any intentional network segmentation policies):
* all containers can communicate with all oth... | Docker's standardnetworking configurationpicks a container subnet for you out of itschosen defaults. As long as it doesn't conflict with any interfaces on your host, Docker is okay with it.Then, Docker inserts an iptables MASQUERADE rule that allows containers to talk to the external world using the host's default inte... |
Can't resolve set hostname from another docker container in same network | I've had db and server container, both running in the same network. Can ping db host by its container id with no problem.
When I set a hostname for db container manually (-h myname), it had an effect ($ hostnamereturns set host), but I can't ping that hostname from another container in the same network. Container id st... | Hostname is not used by docker's built in DNS service. It's a counterintuitive exception, but since hostnames can change outside of docker's control, it makes some sense. Docker's DNS will resolve:the container idcontainer nameany network aliases you define for the container on that networkThe easiest of these options ... |
Running 2 services | I'm building an image for github's Linkurious project, based on an image already in the hub for the neo4j database. the neo image automatically runs the server on port 7474 and my image runs on port 8000.when I run my image I publish both ports (could I do this with EXPOSE?):docker run -d --publish=7474:7474 --publish... | EXPOSEis there to allow inter-containers communication (within the same docker daemon), with thedocker run --linkoption.Port mapping is there to map EXPOSEd ports to the host, to allow client-to-container communication. So you need--publish.See also "Difference between “expose” and “publish” in docker".See also an exam... |
Docker : Drupal container linked to mysql container can't connect to mysql during Drupal installation | I'm fairly new to docker, and I've just been going through the CMS's to see how easy they are to configure. So far, Wordpress and Joomla check out.When I run the drupal container linked to mysql, I get to the drupal installation screen and where it says to connect the DB, and I use my root credentials and db host being... | The followingdocker composefile will startup Drupal connected to another container running Mysqldb:
image: mysql
environment:
- MYSQL_ROOT_PASSWORD=letmein
- MYSQL_DATABASE=drupal
- MYSQL_USER=drupal
- MYSQL_PASSWORD=drupal
volumes:
- /var/lib/mysql
web:
image: drupal
links:
- db:mysql... |
Unable to write file from docker run inside a kubernetes pod | I have a docker image that uses a volume to write files:docker run --rm -v /home/dir:/out/ image:cli argswhen I try to run this inside a pod the container exit normally but no file is written.I don't get it.The container throw errors if it does not find the volume, for example if I run it without the-voption it throws:... | If you want to have that behavior in Kubernetes you can use ahostPathvolume.Essentially you specify it in your pod spec and then the volume is mounted on the node where your pod runs and then the file should be there in the node after the pod exits.apiVersion: v1
kind: Pod
metadata:
name: test-pd
spec:
containers:
... |
passing file to docker command | I am attempting to run opencv through docker container. I have built the image and while running the container directlydocker run -v /home/ganaraj/nndetect:/detect -ti opecv3 bashand accessing the bash$>cd /detect/prediction
$>prediction 1.jpg
0I do get the output I am expecting ( the final 0 ).But I would actually w... | docker exec ismainly for debugging purpose.The primary use case ofdocker execis debugging running containers,docker execbasically is for "exceptional" casesWhen you want to execute a command (here a python program), it is best to run a container just for that command.alias dr='docker run -v /home/ganaraj/nndetect:/dete... |
How to get source code from git repo using DockerFile | I have Git and Docker on a remote Linux machine. The source code of my project is in a bare repo. I need a way of making the source code from this repo available to Docker during the build process.Below is what I have now (which is basically the default template in VS 2017 for a Docker ASP.NET Core project).Q: How do I... | Check out the Git repository outside the Docker build process; ideally, put theDockerfilein the root directory of the repository itself.COPYthe contents of the repository into the image.There are two big problems with trying to dogit cloneinside a Dockerfile:If you have a private repository (which you often do) you nee... |
'docker run' using mount volume option '-v' with single directory as parameter (no source and destination split with colon mark (":")) | On this pagehttps://mherman.org/blog/dockerizing-an-angular-app/,At some point in this tutorial there is this command to launch the container:$ docker run -v ${PWD}:/app -v /app/node_modules -p 4201:4200 --rm example:dev.I don't understand the-v /app/node_modulespart. What is the purpose of-vwhen there are no source an... | thedocker runcommand supports most ofDockerfilecommands, among which theVOLUMETheVOLUMEinstruction creates a mount point with the specified name and marks it as holding externally mounted volumes from native host or other containers.Thedocker runcommand initializes the newly created volume with any data that exists at ... |
Docker volume command line option mistaking files for directories | I have the following command:docker run --privileged=true -it --rm \
-w /usr/src/app \
-v ./package.json:/usr/src/app/package.json \
-v .bowerrc:/usr/src/app/.bowerrc \
-v ./bower.json:/usr/src/app/bower.json \
-v ./build/npm.tmp/node_modules:/usr/src/app/build/npm.tmp/node_modules \
-v ./build/npm... | Try providing an absolute path, instead of a relative path:-v /home/projects/package.json:/user/src/app/package.json |
How to find out which user is accessing /var/run/docker.sock that will cause permission denied error | This question is different from the following questions:Docker: Got permission denied while trying to connect to the Docker daemon socket at unix:///var/run/docker.sockBecause they didn't consider jenkins to be installed as docker container, here I don't have jenkins user to give that user access to this file.And also ... | If you look at the Dockerfile for jenkinsci/blueocean, for example,1.23.2. You can see that the "jenkins" user is uid 1000 and gid 1000. It is these IDs that have to match for volume access, not the username.Rather than granting uid/gid 1000 access to /var/run/docker.sock on the host, perhaps it would be better to ru... |
Azure Container - can not login to private registry "Error response received from the docker registry" | from Azure we try to create container using the Azure Container Instances with prepared YAML.
From the machine where we executeaz container createcommand we can login successfully to our private registry (e.g private.dev on JFrog Artifactory ) after entering passworddocker login private.dev -u svc-faselect
Login succee... | I see few moments that could be the reason of your problem.There should be no=at az container create options--registry-login-server --registry-password and --registry-usernamehttps://learn.microsoft.com/en-us/cli/azure/container?view=azure-cli-latest#az_container_create-examplesCommand should look likeaz container crea... |
docker: Says connection refused when attempting to connect to a published port | I'm a newbie at docker. I'm creating a Hello, World example. All I'm trying to do is bring up Apache in a docker and then view the default website from the host machine.DockerfileFROM centos:latest
RUN yum install epel-release -y
RUN yum install wget -y
RUN yum install httpd -y
EXPOSE 80
ENTRYPOINT ["/usr/sbin/h... | Thanks to all. My ports were reversed:> docker run -p 9191:80 my:apache |
Docker container creating directories owned by root, I need them owned by 1000:1000 | So, I'm trying to get into creating docker images and I managed to get one going. It was qBittorrent, everything went fine until it started downloading files. All of qBits' directories are owned by1000:1000but as soon as it starts downloading a file, my docker-host machine says that the file folder is owned byroot:root... | Managed to get it fixed up. The fix included adding a new user using the Dockerfile . The user automatically receives 1000:1000 as UID and GID but that can be swapped for others if so desired...The Dockerfile is then run as the user with the USER commandAll the directories the USER uses need to be chown -R and to be ch... |
Connecting to Apple's APNS using cURL with HTTP\2 support via nghttp2 | I've attempted to compile cURL with HTTP/2 support by followingthis tutorial. I'm usingDockerand my application is based off theofficial PHP Docker image, which uses Debian, although I've produced the same problems in an Ubuntu machine running inside aVagrantVM.There appears to be no problem at first. Indeed, runningcu... | For anyone seeing this in the future, I ended up solving this, and the answer is onServer Fault. |
Show Kubernetes pod name from docker container running a .Net Core API | Having a .NET Core API running inside a docker container on a Kubernetes cluster: how to tell the API the name of the pod.Is there anyway to forward or inject the information?This could be usefull to pin issues down to pods by enriching logs or connections. | TheDownwardAPI provides the way to expose information to containers.Description from thedocs:This page shows how a Pod can use environment variables to expose
information about itself to Containers running in the Pod. Environment
variables can expose Pod fields and Container fields.Referthis exampleto see how informati... |
Why does docker-compose create an empty host folder when mounting named volume? | I have the following in mydocker-compose.ymlfile:volumes:
- .:/var/www/app
- my_modules:/var/www/app/node_modulesI do this because I don't havenode_moduleson my host and everything gets installed in the image and is located at/var/www/app/node_modules.I have two questions regarding this:An empty folder gets cre... | As an implementation detail, Docker actually uses the Linux kernel filesystem mount facility whenever it mounts a volume. To mount a volume it has to be mounted on to a directory, so if the mount target doesn't already exist, it creates a new empty directory to be the mount point. If the mount point is itself inside ... |
Testcontainer issue with Bitbucket pipelines | I configured bitbucket-pipelines.yml and usedimage: gradle:6.3.0-jdk11. My project built on Java11 and Gradle 6.3. Everything was Ok till starting test cases. Because I used Testontainers to test the application. Bitbucket could not start up the Testcontainer.
The error is:org.testcontainers.containers.ContainerLaunchE... | If used Testcontainers inside the Bitbucket pipelines, There might be some issues. For instance, some issues like mentioned above. This issue can be fixed putting by following commands intobitbucket-pipelines.ymlHere the basic command is an environment variable.TESTCONTAINERS_RYUK_DISABLED=true.
The full pipeline might... |
Copy file(s) within the container in Dockerfile | How can I copy a file from a path within the container to a different pathwithin that same containerin a Dockerfile during the docker-compose build process?COPY This copies a file from the host outside the container. I don't know how to havespecify a file inside the container to copy. | as @tkausl and @JohnKugelman pointed out files can be copied by the following command syntax:RUN cp |
Is it possible to use different .env for different services? | I have a situation where it would be nice to have multiple .env files, one for each service in my docker-compose.yml. Is there any way to specify a different filename to use? Can this be done on the level of individual services?I attempted to use theenv_filetag, unfortunately, this sets variables for use in Dockerfil... | Unfortunately, it's not possible to specify an alternative name for the.envfile. I've wanted to be able to swap that out too, but you can seein the source codethat's it's coded directly to.env.Is there a reason you want to split out substitution variables per service? It feels like you should be able to put the variabl... |
Upstart script to run container won't manage lifecycle | I have an upstart script (say,/etc/init/dtest.conf)start on runlevel [2345]
stop on runlevel [!2345]
respawn
script
DID=$(docker.io run -d ubuntu /bin/bash -c "echo Starting;sleep 20;echo Stopping")
docker.io attach $DID
end scriptWhen issuingstart dtest, the upstart logs show the proper cycle of "Starting ... Stop... | You should create a named container by running the following command:docker run --name dtest ubuntu /bin/bash -c "echo Starting;sleep 20;echo Stopping"Then create the following upstart script (pay attention to the-aflag) which will manage the lifecycle of this container as you expectstart on runlevel [2345]
stop on run... |
Check docker run in Gitlab CICD pipeline | I'm usingGitlab CI/CDto build Docker images of our Node server.I am wondering if there is a way to test thatdocker runof the image was ok.We've had few occasions where the Docker builds but it is missing some files/env variables and it fails to start the server.Is there any way to run thedockerimage and test if it is s... | With Gitlab you are able touse a docker-runner.When you use the docker-runner, and not a shell runner, a docker-like
image and its services have to initiate, it should give an error if
something fails.Chekthis docs from gitlab:This is a classicymlfrom that web:default:
image:
name: ruby:2.2
entrypoint: ["... |
SSL certificate on local Laradock Nginx project | I need your help to set my Laradock (with Docker) using Nginx and SSL "fake" certificate on my local machine.I have no idea how to setup it. Could you please help me?Thanks | To enable SSL with the current version of laradock (as of Nov 2019) with a self signed certificate you must enable it in the nginx settings. Inside the folder nginx/sites remove the comments below line 6 "# For https" :# For https
listen 443 ssl default_server;
listen [::]:443 ssl default_server ipv6only=on;
ssl_certif... |
How to change php-fpm default port? | I'm usingphp-fpmwhich runs for default on the port9000. The problem's that I have other docker container based onphp-fpm, so I need to change the default port to another one, in order to not confusenginx.This is myDockerfile:FROM php:8.0.2-fpm-alpine
RUN sed -i 's/9000/9001/' /usr/local/etc/php-fpm.d/zz-docker.conf
WO... | I think the problem is not the sed command itself, it's related to the wrong file you mentioned for it./usr/local/etc/php-fpm.d/zz-docker.confthis is the file you are trying to change the port in it but inside your docker-compose file you are mapping something else./docker/php-fpm/config/www.conf:/usr/local/etc/php-fpm... |
Docker on Windows Server 2016 TP4 Downloading git in container through powershell | I have an angular UI and a nodejs api. I am currently running windows server 2016 TP4 in Azure.Here are the steps I go through:I am able to remote in, create images, create containers based off those images, and attach to those containers no problem.I pulled a nodejs image from docker:docker pull microsoft/nodeand then... | You can do it like this in admin shell:iex ((new-object net.webclient).DownloadString('https://chocolatey.org/install.ps1'))
cinst -y git |
How to create docker registry mirror | I use MAC OS X.And I want to use mirror in thistutorial, its step 1 is need to do this:docker --registry-mirror=http:// -dBut, when I use this command in terminal, it did't work:flag provided but not defined: --registry-mirror See 'docker --help'.then, I use the other way in tutorial:you may be able to add the --regist... | The problem is the command:$ docker --registry-mirror=http:// -dIs intended for configuring the Docker daemon, not the Docker client. In boot2docker (which is what you're presumably using), this means you need to log into the boot2docker VM and run those commands there.You can log into the boot2docker VM withboot2docke... |
Docker-Compose with PHP and Nginx not working on production | I have a very simple config in docker-compose withphp:7-fpmandnginxthat I want to use to host simple php websites. But I am having issues getting it available in production.Can someone please tell me what I did wrong?Here is docker-compose.prod.yml:version: '3.8'
services:
web:
image: nginx:latest
ports:
... | You need to expose TCP port 9000 of the PHP container to made other containers able to use it (seeWhat is the difference between docker-compose ports vs expose):php:
image: php:7-fpm
expose:
- "9000"
...Do you really want your sites to be available on TCP port 8080, not the standard port 80? If not, c... |
Cronjobs in Docker container how get them running? | I've got some cronjobs in my debian docker container. They don't start automatically why?Do I have to do some workarounds? | If you are running containers in docker, you can add cron tasks on the docker host machine to execute commands in the docker containers.For example, to run 'stress' application in your container every 5 minutes you can add the following (substituting your container ID of course) to your crontab:*/5 * * * * docker exec ... |
automated docker build run error: Unable to find image | I have an automated docker build set up and the build appears to be working fine but when I try to run it I get this error:Unable to find image 'dtwill/ddcintegrationdevenvs:blkmesa_esrbtmq' locally
Pulling repository dtwill/ddcintegrationdevenvs
2014/09/11 14:33:20 Error: image dtwill/ddcintegrationdevenvs not fou... | The image you linked to is private. Did you do adocker loginor create a.dockercfg filebeforedocker run?(BTW, I linked to an outdated commit in the docker source repo for the authentication file since it seems to be broken in the current documentation.) |
How to handle permission inside a volume from docker? | I have a container running a PHP application and thephp-fpmservice can't write the cache files inside an folder provided by a docker volume.I gave 777 permissions on the folder I need to write, from the host machine, but it works just for a while. Files created byphp-fpmdoesn't have necessary permissions.
Furthermore ... | MacOS has some mounting problems because of the differences inuserandgroupowning the file versususerandgroupmodifying/reading the file. As a workaround, do the following (preferably using the latest version) of Docker,$ brew install docker-machine-nfs
$ docker-machine start yourdockermachine
$ docker-machine-nfs yourdo... |
Why I cant access a kubernetes pod from other Nodes IP? | I've installed kubernetes cluster with help of Kubespray.
Cluster having 3 Nodes (2 Master & 1 Worker).
node1 - 10.1.10.110,
node2 - 10.1.10.111,
node3 - 10.1.10.112$ kubectl get nodes
NAME STATUS ROLES AGE VERSION
node1 Ready master 12d v1.18.5
node2 Ready master 12d v1.18.5
node3 Ready ... | Because you have only one pod on 10.1.10.110Your curl is wrong, you didn't deploy a pod on 111 and 112 nodes, this is the reason that the endpoints aren't working. Just executecurl http://10.1.10.110:31520on the other nodes and it will work |
How do I push to a git server on a container? | On my host machine, I'm able to create a second user:adminandpushto that user's git folder using:admin@localhost:folderWhen I create a Docker container hosting a git server, after exposingport 22how do Igit pushfrom my local machine tolocalhost:22which would be the location of the container's ports? | Probably you are trying to bind docker container port 22 to already occupied port 22 of your host. You need to map container ssh server to other not occupied port of your host e.g. 5000.You can expose particular ports during container start-up with flag "-p HOST_PORT:CONTAINER_PORT":docker run -p 127.0.0.1:5000:22 dock... |
can you combine separate builds from docker? | I am using circleci to deploy an application, I deploy to both amd and arm architectures so my builds are multi-arch which I have been using docker buildx for. With the new arm support from circleci I was able to cut the time on this process down from sometimes 3 hours using quemu, to around 20 minutes by building both... | There are two options I know of.First, you can have buildx run builds on multiple nodes, one for each platform, rather than using qemu. For that, you would usedocker buildx create --appendto add the additional nodes to the builder instance. The downside of this is you'll need the nodes accessible from the node runningd... |
Docker taking all space 100% | My VM where I installed docker is full, so the docker daemon stopped. Now I saw a lot of solutions on how to fix it, but the problem is all of them requiring that the docker daemon is running (docker system prune). But when I want to start the docker daemon, it can't and this message appears:Error starting daemon: Unab... | I found a solution. One of my docker container produces 9GB of logs. You can just clear those logs manually.Sort the/var/lib/docker/containersdirectory to show which container directories have the largest log files:du -d1 -h /var/lib/docker/containers | sort -hClear the contents of a log filecat /dev/null > /var/lib/do... |
gdb exits immediately `Process finished with exit code 1` or lldb `'A packet returned error 8'` on docker. Also: How to allow c++ debugging in docker | This took me full days to find, so I am posting this for future reference.I am developing C++ on a docker image. I am using clion.My code is compiled in debug mode, and runs fine in run mode, but when trying to debug, the process exits immediately with the very informativeProcess finished with exit code 1When switching... | Eventually, I foundthis commentwhich led me tothis blog post, in which I learned C++ debugging is disallowed on docker by default.The arguments --cap-add=SYS_PTRACE and --security-opt
seccomp=unconfined are required for C++ memory profiling and debugging
in Docker.I added--cap-add=SYS_PTRACE --security-opt seccomp=unco... |
PHP date.timezone not found with Docker & PHP-FPM | I'm creating a Symfony environment (PHP-FPM, Nginx, & more) with Docker & Docker-compose.But, PHP does not use my php.ini and ignores the config (date.timezone parameter is not found in my Symfony application).Of course, when I go on my container, the date.timezone is correctly set in the 2 php.ini (cli & FPM).I don't ... | Official PHP Docker Image use/usr/local/etc/phpas base folder: seeDockerfile. |
How to put self-signed certificate to each node of GKE cluster? | I have a kubernetes cluster in GKE. Inside the cluster there is an private docker registry service. A certificate for this service is generated inside a docker image by running:openssl req -x509 -newkey rsa:4096 -days 365 -nodes -sha256 -keyout /certs/tls.key -out /certs/tls.crt -subj "/CN=registry-proxy"When any pod t... | TL;DR: Almost all modifications you need to perform to nodes in GKE, like adding trusted root certificates to the server, can be done using Daemonsets.There is an amazing guide that the userSam Stoelingacreated about how to perform what you are looking to do. The link can be foundhere.As a summary, the way Sam propose ... |
VS2017 Build Fail - DOCKER_REGISTRY | I'm getting started with Docker and familiar with .NET Core and Visual Studio 2017. I've created a new Web Application (Razor Pages) named "WebApplicationCore21" with Docker Support enabled and receive a nice Dockerfile out the gate.FROM microsoft/dotnet:2.1-aspnetcore-runtime-nanoserver-1709 AS base
WORKDIR /app
EXPO... | I found mysolutionthis morning based on theunauthorized: incorrect username or passworderror.When I checked Docker for Windows in the system tray, I was logged in using my Docker Hub email address. Docker for Windows finds this acceptable, which is misleading. Doing so causes trouble for apps it interacts with like V... |
Docker - Spring Boot application - cannot access MySql server on localhost | How can I connect a Spring Boot (JAR) application, running in Docker, to my MySql server on my computer? [I tried different posts, but that didn't help]In my Spring Boot 'application.properties' I have:spring.datasource.url = jdbc:mysql://localhost:3306/geosoldatabaseI tried a number of options:$ docker run -p 8080:808... | Use --network="host" in your docker run command, then 127.0.0.1 in your docker container will point to your docker host. Refer to the answers inthis post. |
Mongodb docker container with client access control | I want to create a docker container with a mongodb configured with client access control (user authentication, seethis).I have successfully configured a docker container with mongo usingthis image. But it doesn't use mongo access control.The problem is that to enable access control I have to run mongodb with a specific... | Ok, I have found a solution. Basically MongoDb has a feature that allow to setup access security (--auth) but permit localhost connection.
Seemongo local exception.So this is my final script:# Create a container from the mongo image,
# run is as a daemon (-d), expose the port 27017 (-p),
# set it to auto start (--re... |
What is the easiest way to run a single NodeJS script using Docker and be able to terminate it with Ctrl-C | Taken from Docker's documentation that if you want to run a standalone NodeJS script you are supposed to use the following command:docker run -it --rm --name my-running-script -v "$PWD":/usr/src/app -w /usr/src/app node:8 node your-daemon-or-script.jsThis works except that it's not possible to stop the script using Ctr... | This note is hidden in theextendeddocker rundocumentation:Note:A process running as PID 1 inside a container is treated specially by Linux: it ignores any signal with the default action. So, the process will not terminate onSIGINTorSIGTERMunless it is coded to do so.The main Docker container process (your container'sEN... |
Pull access denied for pycharm_helpers, repository does not exist or may require 'docker login' | I am attempting to run the pycharm debugger inside a docker container. This has worked for me in the past, so I know my config is right, but during one of my docker container purges, I must have deleted a container pycharm needs, pycharm_helpers. Unfortunately pycharm can't recover and pull/rebuild the correct images i... | This was happening to me because Pycharm was holding onto stale containers, running (remove pycharm containers):docker ps -a | grep -i pycharm | awk '{print $1}' | xargs docker rm, then doinginvalidate cache and restartin pycharm fixed it for me. |
java.net.InetAddress java class doesn't resolve IP on Alpine Docker container | When I run this code below inside containerDockerrunning Java JDK 8 onAlpine Linuximport java.io.*;
import java.util.*;
import java.net.*;
public class SomaDBTest {
public static void main(String... args) throws Throwable {
InetAddress ip = InetAddress.getByName("mysql");
System.out.println("Begin - my... | You can put the command bellow on yourDockerfileto solve this problemRUN echo 'hosts: files mdns4_minimal [NOTFOUND=return] dns mdns4' >> /etc/nsswitch.conf |
ImportError: No module named google.auth | When I try to importfirebase_admininpython 2.7I get the error:ImportError: No module named google.authThis is theDockerFileI'm using.I've installed Python from the source code usingwget https://www.python.org/ftp/python/2.7/Python-2.7.tgz
tar xvzf Python-2.7.tgz
cd Python-2.7
./configure
make
make installThen I've inst... | I looked into the image ofadamantium/flutterand saw in the Dockerfile that it depends onubuntu:18.04which is shipped with Python2 directly, as mentioned in PEP-394 (see the link below for more information on this).https://www.python.org/dev/peps/pep-0394/So, I don't understand why you want to re-install it again. What ... |
docker login using -p gives error, and when I switch to --password-stdin like it recommends still gives error - gitlab-ci | I have a docker registry setup on my gitlab server. Here is my .gitlab-ci.yml file:image: docker:18.05.0-ce
services:
- docker:dind
stages:
- build
- test
- release
variables:
TEST_IMAGE: http://my.gitlab.ip:4444/path/to/project:$CI_COMMIT_REF_NAME
RELEASE_IMAGE: http://my.gitlab.ip:4444/path/to/project:... | I'm not sure when you set this up, but there is an updated permission model afterGitLab 8.12when using GitLab runners and logging into the GitLab Container registry.Asper the docs, you can do:before_script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY |
checkCompilerOptions Error while installing package (littler/Docker) | On its last line,thisDocker file callslittler::install.rto installRcppRcppEigenandmatrixStats.The whole code was working like a charm a couple of months back. Now, it bombs at that last step. More precisely,RcppandRcppEigenstill install perfectly, but when it comes to installingmatrixStats, I get:installing to /usr/loc... | From the top of my head I'd blame a change inmatrixStats[ but see below and it appears blameless ] -- I am somewhat familiar with all the other moving parts and not aware of changes or bugs.One thing that is fishy though is the trailing line break:RUN install.r Rcpp RcppEigen matrixStats \You may try without it.Edit:A... |
docker linking how can both containers know each others ip | From the docker linkingI can have A container links to B container.Then I can see the B's ip address and exposed port in A's ENV variables.However, how can I figure out A's ip address wihtin B container? | To find one container from another, you can use a 'service discovery' mechanism such asSkyDock.Skydock - Automagic Service Discovery for DockerSkydock monitors docker events when containers start, stop, die, kill, etc and inserts records into a dynamic DNS server skydns. This allows standard DNS queries for services ru... |
docker log driver "json-file" log loss when rolling update | If the max-file value is set to 2, two files are created as shown below.11111-json.log
11111-json.log.1But here, when the11111-json.logfile size ismax-size, the contents of11111-json.logare moved to11111-json.log.1, and the size of11111-json.logBecomes zero.
/var/log/container
At this point I lose the last log.The log... | According to your settings, all logs .log.1, .log.2 are stored in /var/lib/docker/containers/... and as per docker documentation you can change those settings for docker indaemon.json:"log-driver": "json-file",
"log-opts": {
"max-size": "10m",
"max-file": "3",in /var/log/containers you can find link to the la... |
Ensure ECS only kills old tasks when new ones are ready | We have Docker-based ECS services where once the process is up, it needs to synchronize application state before it is ready to start serving requests. This can take some time (a number of seconds after the process starts).When using ECS Services, changing the task definition version triggers a rolling replacement of t... | You can control the speed at which a deployment proceeds by setting the following parameters:deploymentConfiguration(specifically, theminimumHealthyPercentin your case)enabling health checks (withload balancer health checksif you are using a load balancer or withcontainer health checks)settinghealthCheckGracePeriodSeco... |
Apt-get not working within ubuntu dockerfile | I am fairly new to docker and am trying to learn by writing my own images and, for now, reading Docker in action (ISBN: 1633430235)In both my own code and an example from the book (pg 146) I would like to install git via a dockerfile.My code:# set base image
FROM ubuntu:18.04
# author
MAINTAINER me
############## Begin... | TryFROM ubuntu:18.04
RUN \
apt-get update \
&& apt-get install -y \
git-coreI'm not sure, but emptylines in Dockerfile was problem |
docker registry with --insecure-registry and docker 1.5 | I have an issue with docker 1.5.So, I run a private registry at myregistry:5000.
I can push & pull from an other location (debian 7 & docker 1.4) with :DOCKER_OPTS="--insecure-registry myregistry:5000"in /etc/default/dockerNow, I have a new system with docker 1.5 and debian 8, it's not working anymore.
I tried all pos... | If it can help anyone,
I think the problem not coming from Docker, (I tried to update my registry with no success) but fromsystemdstart command.So, it's not a clean solution, but it still cleaner than launching docker in a screen.I modify/lib/systemd/system/docker.serviceand change theExecStartline :ExecStart=/usr/bin... |
Is there a way to see container disk usage on Docker for Windows? | I'm curious if there's a way to see how much disk space a running Windows container is using in addition to the layers that are part of the container's image. Basically, how much the container "grew" since it was created.In Linux (Or Linux containers running in a HyperV), this would bedocker ps -s, however that comman... | I checked on Windows 10 1809 running non-HyperV (process isolation) containers, I'm pretty sure its the same for Windows Server containers.The data seems to be kept in:C:\ProgramData\Docker\windowsfilter\{ContainerId}There's a direct reference to the folder indocker inspect {Id}underGraphDriver\Data\dir.The folder cont... |
docker compose nginx and tomcat, expose only nginx on internet | I´m working with a Docker compose file to create a nginx and tomcat container. nginx will be used as a reverse proxy so then it access the tomcat. I was able to do this successfully with 2 separate contaienrs using azure container instaces. you hit the URL of the nginx and then you got redirected to tomcat securley as ... | By using the ports option in your docker-compose you are exposing that port externally. If you remove the ports option from tomcat it should still work since the container should expose the port 8080 internally only for the docker network. |
How to connect to mysql running in container from host machine | I'm usinghttps://github.com/sameersbn/docker-mysqlto run a mysql container usingdocker-machinein OSX with virtualbox.I created a new machinedocker-machine create --driver virtualbox mytestThe IP isdocker-machine ip mytest
192.168.99.103I run the container like this:docker run -p 3306:3306 --name mysql -d \
-v /opt/my... | By default, root only has access from the localhost, 127.0.0.1 & ::1, you need to specifically allow access from 192.168.99.1 or from anywhere using '%' in the user setup : see herehttp://dev.mysql.com/doc/refman/5.5/en/default-privileges.html |
Running Remote Bamboo Agents on Demand Using Docker [closed] | Closed. This question needs to be morefocused. It is not currently accepting answers.Want to improve this question?Update the question so it focuses on one problem only byediting this post.Closed5 years ago.Improve this questionI'm trying to see if it would be viable to automatically spin up Bamboo containers for a CI ... | I've been working for a while with Bamboo and remote agents on Docker and I happened to have tried to achieve to same thing. To simply answer your question :No, this is not viable in my opinion.
What you are trying to do is basically what Atlassian calls elastic agents but it only works for AWS for now.In the current s... |
Why use docker service? | Thisquestion illustrates the theoretical differences betweendocker runanddocker service.What I don't understand is when would one need to use the exact same container replicated multiple times (as per theDocker documentation example)?
There, they run the same web app replicated 5 times.Is deployment on Kubernetes (for ... | swarmis an orchestrator just likekubernetes.docker servicedeploys services toswarmjust as you deploy your services tokubernetesusingkubectl.swarmis essentially built-in primitive orchestrator. One possible case for replicas is running a proxy that directs requests to proper containers. You could expose multiple machine... |
.Net Core on Heroku with Docker | ContextI'm trying to deploy aaspnet coresample-app onHerokuwith docker but is not working.repo:https://github.com/mykeels/sample-web-apiguide:https://blog.devcenter.co/deploy-asp-net-core-2-0-apps-on-heroku-eea8efd918b6EnvorimentFramework.NET Core 2.1.201SO:W10 Build 17134.1Docker:Docker for Windows Version 18.03.1-ce-... | SOLUTIONFirst: Replace thedocker taganddocker pushcommands with:heroku container: push web -a That's when I discovered that theheroku registryconnection was not set up.Command to configure:heroku container: loginThis command only works with windows on the default terminal (does not work incmderwith bash).or the command... |
How can Cloud Build take dynamic parameters to increment a registry tag? | I want my Cloud Build to push an image to a registry with an incremented tag. So, when the trigger arrives from GitHub, build the image, and if the latest tag was1.10, tag the new one1.11. Similarly, the1.11value will serve in multiple other steps in the build.Reading the registry and incrementing the tag is easy (in ... | Sadly you can't. The Cloud Builder image have each time their own sandbox and only the/workspacedirectory is mounted. By the way, all the environment variable, binaries installed and so, doesn't persist from one container to the next one.You have to use the shell script each time :( The easiest way is to have a file in... |
Dockerizing multi module Spring Boot application using JIB plugin | I have a Spring boot Application and using spotify plugin to Dockerize my application.So, I will have a Dockerfile like the below one.FROM jdk1.8:latest
RUN mkdir -p /opt/servie
COPY target/service.war /opt/service
ENV JAVA_OPTS="" \
JAVA_ARGS=""
CMD java ${JAVA_OPTS} -jar /opt/service/service.war ${JAVA_ARG... | Yes indeed.JIBdoesn't needDockerfileordockerd.Sharing an example below, you can just copy it intopluginssection of yourpom.xml
com.google.cloud.tools
jib-maven-plugin
0.9.7
true
gcr.io/distroless/java
gcr.io/my-gcp-project/${project.artifactId}:${project.version}
gcr
-Xms256m
-Xmx512m
-Xdebug
-X... |
Docker-machine Port Forwarding on Windows not working | I'm attempting to access my django app running within Docker on my windows machine. I'm using docker-machine. I've been taking a crack at this for hours now.Here's my Dockerfile for my django app:FROM python:3.4-slim
RUN apt-get update && apt-get install -y \
gcc \
gettext \
vim \
curl ... | The issue was that the server was running on127.0.0.1when it should have been running on0.0.0.0.I changed theCMDline in the Dockerfile fromCMD ["python", "manage.py", "runserver", "8000"]toCMD ["python", "manage.py", "runserver", "0.0.0.0:8000"]and it now works. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.