Prompt stringlengths 14 160 | Instruction stringlengths 18 2k | Response stringlengths 8 2k |
|---|---|---|
Docker container mongod error when starting via ssh | I have installed mongodb on a docker container together with openssh on ubuntu 14.04. The container is running with ssh but when I ssh into the container I get the following error when trying to start mongod.root@430f9502ba2d:~# service mongod start
Rather than invoking init scripts through /etc/init.d, use the service... | The problem here is your approach. Docker does not have an init system like you are used to on traditional systems. What docker does isreplacePID 1 with the process you specify in theCMDorENTRYPOINTDockerfile commands. For now, ignoreENTRYPOINT, because it replaces what yourCMDis run with (normally, it's/bin/sh -c). Yo... |
Sharing a configuration file to multiple docker containers | Suppose I have the following configuration file on my Docker host, and I want multiple Docker containers to be able to access this file./opt/shared/config_file.ymlIn a typical non-Docker environment I could use symbolic links, such that:/opt/app1/config_file.yml -> /opt/shared/config_file.yml
/opt/app2/config_file.yml ... | What about host mounted volumes? If each application is only reading the configuration and the requirement is that it lives in different locations within the container you could do something like:docker run --name app1 --volume /opt/shared/config_file.yml:/opt/app1/config_file.yml:ro app1image
docker run --name app2 --... |
Deploying Create React App on OpenShift: EACCES: permission denied, open '/home/node/app/.eslintcache' | I'm trying to deploy a Create React App webapp on OpenShift using a Dockerfile. The OpenShift build completes successfully and when I visit the route I'm able to see the application running for 1 second and then this error comes on the screen:Failed to compile
EACCES: permission denied, open '/home/node/app/.eslintcach... | You're setting up a specific user and permissions for that user. OpenShift's default configuration is to run containers with a random UID. It's recommended to use the root GID (GID 0) when setting permissions, instead of UIDs, as OpenShift will automatically apply GID 0 to the user.You can find more guidelines on creat... |
Docker $(pwd) and bash aliases | I'm running Docker CE in Ubuntu 16.04. I've created a Docker image for the polymer-cli.
The idea is to be able to run polymer commands from inside disposable docker containers using bash aliases that mount the current directory, run the command and then destroy the container, like this:docker run --rm -it -v $(pwd):/h... | The problem is that, as you have used double quotes, the command substitution is being done at the time ofaliasdeclaration, not afterwards.Use single quotes:alias polymer='docker run --rm -it -v $(pwd):/home/node/app -u node fresnizky/polymer-cli polymer'Also, instead of using thepwdcommand substitution,$(pwd)you can u... |
Docker task in Azure devops won't accept "$(pwd)' as variable | I tried to run a docker command through the docker task in Azure devops with the build in docker task.
As variable for the volume of the docker command I gave this as valueBut it keeps failing with the error/usr/bin/docker: Error response from daemon: create $(pwd)/out: "$(pwd)/out" includes invalid characters for a lo... | You're trying to reference a variable namedpwd. There isno such predefined variablein Azure Pipelines.You mention that this works in your local machine, but that's not because there's apwdvariable defined. (In fact, there's probablynotapwdenvironment variable in your environment.) That's because$(pwd)isPOSIX command... |
Development workflow for server and client using Docker Compose? | I'm developing a server and its client simultaneously and I'm designing them in Docker containers. I'm using Docker Compose to link them up and it works just fine for production but I can't figure out how to make it work with a development workflow in which I've got a shell running for each one.Mydocker-compose-devel.... | Here's a solution I came up with that's hackish; please let me know if you can do better.docker-compose-devel.yml:server:
image: node:0.10
command: sleep infinity
client:
image: node:0.10
links:
- serverIn window 1:docker-compose --file docker-compose-dev.yml up -d server
docker exec --interactive --tty $(... |
webpack and react jsx - hot loading not working with docker container | Changed to: hot loading does not work in docker and it looks like it is a docker issue.Following this:React with webpackor thisReact hot loaderon local host machine they work fine and to me, they work the same - still I dont get why you would installReact hot loader?But running it in a container, updating/"hot loading"... | Asdescribed on GitHub, you can do this:watchOptions: {
poll: true
}Or, in thepackage.json, instead of--watchdo--watch --watch-poll. |
Connection refused by Spring boot app running in different docker container | I have three apps running in 3 containers on the same host.CONTAINER ID IMAGE COMMAND PORTS
3f938111c1bf registration "java -jar registration.jar" 0.0.0.0:8030->8030/tcp
cb9c4782194e security "java -jar security.jar" 0.0.0.0:802... | When you work with docker containers/images so you need to set your configurations on them. So you must change localhost to your container name. For example:http://localhost:8020/security/register
http://authentication:8020/security/register |
How to set a docker-compose /bin/bash entrypoint? | I'd like to enter a docker container in interactive mode with the commad /bin/bash using a docker-compose.yml only. There is a similar question here on stack overflow:Interactive shell using Docker ComposeAnswers provided there didn't work. This is what my docker-compose.yml looks like:version: "3"
services:
server:
... | In that particular use case the solution should be like below. The reason for this is usually /bin/bash is used with-tito enter a shell inside the container.The same thing can be done with compose by using the run command with a particular service. Note that I am exposing the service ports too.docker-compose run --ser... |
Kubernetes NFS PersistentVolumeClaim has status Pending | I am trying to configure my Kubernetes cluster to use a local NFS server for persistent volumes.I set up the PersistentVolume as follows:apiVersion: v1
kind: PersistentVolume
metadata:
name: hq-storage-u4
namespace: my-ns
spec:
capacity:
storage: 10Ti
accessModes:
- ReadWriteMany
persistentVolumeRecla... | It turned out that I needed to put the IP (I also put the path) in quotes. After fixing that, the pvc goes to status Bound, and the pod can mount correctly. |
Docker container ID uniqueness in docker service | I have read how the containers are assigned the containers IDs:How the docker container id is generatedHow is the docker ID uniqueness verified?
And in which pool is it unique?
Among all exited, among all running, among all deleted/removed, among all ever created by a specific docker service?I was wondering whether the... | The ID needs to be unique within a given docker host among all containers that currently exist (including exited and created containers). Once deleted, the engine no longer tracks the container ID. A container could potentially reuse the same container ID as a previously existing container, but the odds of that are fai... |
Jenkins: How to use JUnit plugin when Maven builds occur within Docker container | I am trying to create a Pipeline where Jenkins builds my Docker image, runs tests, and then deploys the container if the tests pass. The problem is that I have maven running inside the docker container, and I can't actually access the published tests until I run the container. I want the Docker container to be ran and... | You could create an temporary container just beforejunitto extract test results files to copy test result to your workspsace. And finally remove itsh 'docker create --name temporary-container spring-image'
sh 'docker cp temporary-container:/var/www/java/target/surefire-reports .'
sh 'docker rm temporary-container'
juni... |
apt-get not working in Dockerfile | ANSWER: I still don't know what was really wrong but after I restarted docker and ran it again (same dockerfile, same everything), it worked fine.I'm using Docker on Windows and my Dockerfile isFROM ubuntu:15.04
COPY . /src
RUN apt-get update
RUN apt-get install -y nodejs
...etcbut when I try to build the image I g... | I restarted docker and tried again and now it works fine. |
How do I run a Docker container that uses SystemD from the latest version of Ubuntu (18.10)? | I'm trying to execute a Docker image built using 'ubuntu:latest' and I keep getting SystemD error messages when I run the container:System has not been booted with systemd as init system (PID 1). Can't operate.If I try thissolutionand spawn the container usingdocker run -it -e container=docker your-image-name /sbin/ini... | You can solve this using a different version, like 16.04:docker run -d \
-h ubuntu \
--name ubuntu \
--privileged \
docker.io/library/ubuntu:16.04 /sbin/initAfter run, you can accessed using the follow command:docker exec -it ubuntu /bin/bashThis version usessystemd. |
Can I have extra slash "/" in Docker (and Containerd) image name? | I need to copy images from Docker Hub into a private registry. For example, I needredislabs/rebloom:2.2.2. Then, can I name itmy-private-registry.com/my-organization/redislabs/rebloom:2.2.2? (Notice there ismy-organizationwhich Icannotmodify.)In other words, isa.com/b/c/d:v1.0ok or not?I readthispost and see Docker can... | My day job uses image names with a similar structure (hosted on Amazon ECR) and they work fine with plain Docker, Compose, and Kubernetes. I would not expect to run into any trouble with this, unless the specific image repository has stricter rules. |
How to run mongorestore after mongod in docker | I'm trying to set up a mongodb-server with docker, let it download a dump from the web and populate it with that info. My problem is that I can make it run and fill the database, but after it's done that, it just closes.This was how I went about solving my problem:sudo -u mongodb /usr/bin/mongod --config $conf $args &
... | Start your mongod containerdocker run -d --name mymongod ... mongo ...Start a 2nd container for mongorestore, linking it to the first:docker run --link mymongod:db ... mongo mongorestore -h db ...mongorestorewill connect to themymongodcontainer via the aliasdbthat docker creates based on the specified--link |
How to redirect stdout from docker container to host | I'm trying to call docker's mysqldump from host system for save mysql dump from golang. It works correctly with host mysqldump, but don't work with docker's mysqldump.func writeDb(dbName string)
{
var mysqldumpPath string = "/usr/bin/mysqldump"
//var mysqldumpPath string = "/Applications/MAMP/Library/bin/mysqldump"... | The solution is:func writeDb(dbName string) {
var mysqldumpPath string = "/usr/bin/mysqldump"
cmd := exec.Command("docker", "exec", "some-mysql", mysqldumpPath, "-u", fmt.Sprintf("%s", USER), fmt.Sprintf("-p%s", PASSWORD) , fmt.Sprintf("%s", dbName))
stdout, err := cmd.StdoutPipe()
if err != nil {
log.Fatal(err)
}... |
How to install vim in a docker image based on mysql version 8? | I had been using mysql version 5.7 and this was working.Dockerfile (working)FROM mysql:5.7
...
RUN yum update -y; yum install -y vimThen I upgraded to mysql 8 and now I'm getting this error.$ gnt build
...
#5 [ 2/12] RUN yum update -y; yum install -y vim
#5 sha256:a564337cc7df72796c4c967652d420ef76ec98034de106834a4... | If you take a look at the Tag for 8.0 you can see that the base uses a different version of Oracle linux (8 vs 7). Yum is not installed in 8. Instead, there's a minimal installer (microdnf). So this substitution should work for you:microdnf install -y vim |
Setting ssh public keys on Docker image | I setup a Docker image that supports ssh. No problem, lots of examples. However, most examples show setting a password using passwd. I want to distribute my image. Having a fixed password, especially to root, seems like a gaping security hole. Better, to me, is to setup the image with root having no password. When a us... | What about generating a private key and display it to the user?I use this snippet as part of the entrypoint script for an image:KEYGEN=/usr/bin/ssh-keygen
KEYFILE=/root/.ssh/id_rsa
if [ ! -f $KEYFILE ]; then
$KEYGEN -q -t rsa -N "" -f $KEYFILE
cat $KEYFILE.pub >> /root/.ssh/authorized_keys
fi
echo "== Use this pr... |
How to modify a file in a Docker container when deploying with Terraform and Kubernetes? | As a part of a bigger module, I want to deploy annginxcontainer and replace its defaultnginx.conf. The new config should be built using Terraformresources' data which is generated at the time of deployment. Is there a way to do it? | I managed to replace the standard nginx.conf with a dynamically generated one following these steps:Create a template config file with placeholders for dynamic dataParse the file using Terraform'stemplate_filedata sourceStore the parsed data in a ConfigMap and mount the map as a volume for the Nginx containerStep by st... |
Docker: Set value of ENV variable using RUN command? | I'm writing a Dockerfile to set up my customized WordPress environment. I'm starting with ubuntu:latest and would like to add some repositories dynamically, by setting an ENV variable to the codename of the current Ubuntu version. How can I do this, or is there a better way to achieve this? | Start your container like this:docker run -e VAR=value -e ANOTHER_VAR=another_value .... VAR and ANOTHER_VAR will be available in the container's environment. |
How do you do cancel a dockerfile image building on the first error it encounters? | If I have an error in a RUN command in my dockerfile it just carries on to the next one. | Are you sure the command is really returning an error? The following Dockerfile doesn't get to theecho foo:FROM alpine
RUN false
RUN echo fooIt just gets:# docker build .
Sending build context to Docker daemon 3.072 kB
Step 0 : FROM alpine
---> 0a3b5ba3277d
Step 1 : RUN false
---> Running in 22485c5e763c
The command... |
How to add "-v /var/run/docker.sock:/var/run/docker.sock" when running container from kubernetes deployment yaml | I'm setting up a kubernetes deployment with an image that will execute docker commands (docker psetc.).My yaml looks as the following:kind: Deployment
apiVersion: apps/v1
metadata:
name: discovery
namespace: kube-system
labels:
discovery-app: kubernetes-discovery
spec:
selector:
matchLabels:
disco... | You want to add the volume to the container.spec:
containers:
- name: discover
image: docker:dind
volumeMounts:
- name: dockersock
mountPath: "/var/run/docker.sock"
volumes:
- name: dockersock
hostPath:
path: /var/run/docker.sock |
Can I remove `RUN apk add --no-cache python2 g++ make` from my Dockerfile? | In thedocker tutorialI'm following it tells me to put the following commands in myDockerfile:# syntax=docker/dockerfile:1
FROM node:12-alpine
RUN apk add --no-cache python2 g++ make
WORKDIR /app
COPY . .
RUN yarn install --production
CMD ["node", "src/index.js"]I understand what all of the lines are doing, except for:R... | Reading the PRwhich added that line, it seems like it was added to fix an issue with Apple M1 support for the node-gyp package. A later PRtook the line back out, but that change does not seem to be reflected on the docker website.That does beg the question of why it breaks on M1, but I don't have an M1 laptop, so I can... |
local files missing from docker-machine container | So I have a simple containerised django project, with another container for sass css compilation.I use docker-compose with a docker-machine, but when I fire it up, the web container doesn't have any of my local files (manage.py etc) in, so it dies with afile not found: manage.pyerror.Let me explain more:docker-compose.... | Docker volumes mount files from thehostinto the container.So in this case, you've mounted the current directory of whatever host docker-machine is pointing to into the container. Unless you have some funky VM crossmounting going on (like boot2docker does), this isn't going to match the directories on the machine you're... |
How can I use a python interpreter in a singularity/docker image in visual studio code | I want to be able to use a python interpreter inside a singularity image from visual studio code.It seems that all of the options to point VSC to python interpreters involve a direct path, but using python within an image requires a command:singularity exec path/to/image.img python3.6I tried putting this in the VSC set... | The easiest way is to use the singularity image's runscript and set"python.pythonPath": "path/to/python.img"e.g.,$ sudo singularity build py36.simg docker://python:3.6
Docker image path: index.docker.io/library/python:3.6
Cache folder set to /root/.singularity/docker
[9/9] |===================================| 100.0% ... |
How to set up an environment variables on google kubernetes engine? | I am usingFirebasein myGoLangproject hosted onGoogle Kubernetes Engine.Steps I followed:Enable firebase admin SDK on the firebase account. It generated a service accountJSONfor me. This also created a service account under my Google console service credentials.Followed thisanswerand add a new secret key usingkubectl cr... | Finally, I figure out how to copy it and use the environment variable. Here is. the updatedYAMLfileapiVersion: apps/v1beta1
kind: Deployment
metadata:
name: my-app
spec:
template:
spec:
volumes:
- name: google-cloud-keys
secret:
secretName: gac-keys
containers:
- name: ... |
Does pyinstaller have any parameters like gcc -static? | I have a similar question to this :Is there a way to compile a Python program to binary and use it with a Scratch Dockerfile?In thispage, I saw that someone said that a C application runs well when compiled with-static.So I have a new question: doespyinstallerhave any parameters likegcc -staticto make a python applica... | From the questionDocker Minimal Image PyInstaller Binary File?'s commands,I get thelinksabout how to make python binary to static,which like the go application demo,say hello world in scratch.And I do a single ,easy demo,app.py:print("test")Then,do docker build with the Dockerfile:FROM bigpangl/python:3.6-slim AS comp... |
Vagrant and Docker with Microservices | I have a set of microservices whose deployment I would like to automate and standardize using Docker. I have been reading about Vagrant and I have a couple of questions on using Vagrant for setting up the environment.I understand that Vagrant is used for setting up VM's and Docker for creating containers. What is the b... | Answer for first question:Vagrant is a way to quickly setup docker based container on your local machine. To run docker containers, you need linux kernel which you can provide either by running container on your physical machine. But having vagrant's provisioned vm and running containers will benefit in following wayYo... |
How do I specify the dockerfile location in my github action? | I'm adding a dockerfile to my asp.net core application and it's located in a subdirectory. I'm trying to create a github action to run the dockerfile, but the action is having difficulty finding it.
My folder structure is:api/
|--Data/
|--Service/
|--|--Dockerfile
|--Tests/
|--MyProject.sln
frontend/My action.yml is:na... | There is an issue in this line:run: docker build ./api/Service/ --file Dockerfile --tag my-image-name:$(date +%s)The usage of--fileflag is wrong. The correct way would be:run: docker build --file ./api/Service/Dockerfile --tag my-image-name:$(date +%s) |
Setting up node with redis using docker-compose | I have an Express app and React app, and in the backend part I'm using Redis. I setup one Dockerfile for the frontend, and one for the backend. Additionally, I setup thedocker-compose.ymlfile, which looks like this:# Specify docker-compose version.
version: '3'
# Define the services/containers to be run.
services:
r... | From the logs it seems that it tries to connect to REDIS onlocalhost(127.0.0.1). The express docker container can reach REDIS by service name which isredis.Try to replacelocalhostwithredisinredisConnectionString. Something like:redis://[[user][:password@]]redis:6379Hopefully that will solve your problem. |
Run yaml file for parallel selenium test from R or python | I have a simple yaml file:seleniumhub:
image: selenium/hub
ports:
- 4444:4444
firefoxnode:
image: selenium/node-firefox-debug
ports:
- 4577
links:
- seleniumhub:hub
chromenode:
image: selenium/node-chrome-debug
ports:
- 4578
links:
- seleniumhub:hubthat I ... | This is duplicate ofRun RSelenium in parallelYou can use code in above answer to do parallel executionlibrary(RSelenium)
library(rvest)
library(magrittr)
library(foreach)
library(doParallel)
URLsPar <- c("http://www.bbc.com/", "http://www.cnn.com", "http://www.google.com",
"http://www.yahoo.com", "http://... |
Debian - /usr/bin/env: 'php\r': No such file or directory | So go straight to the problem, when I run./yiiseems I got that error from Debian:stretch that I ran from Docker.However when I run/usr/bin/env php -vI got the correct output and there's no problem on it.Seems there's a problem on new line being translated as string and I have no idea how to fix it.Sorry if my English a... | You should convert the file with UNIX new line convention.You have a DOS file, which has the extra\rcharacter before\n, which is interpreted as a character in the command. So system will check the programphp\rand notphp, and so it fails.tr -d '\15' < original_file > converted_fileshould do the work (StackOverflow has m... |
Docker fails with "failed to start containerd: timeout waiting for containerd to start" | I have docker installed on Ubuntu 18.04.2 with snap.When I try to start docker it fails with the following error log.2020-07-16T23:49:14Z docker.dockerd[932]: failed to start containerd: timeout waiting for containerd to start
2020-07-16T23:49:14Z systemd[1]: snap.docker.dockerd.service: Main process exited, code=exite... | In this case, docker was waiting for containerd to start. The containerd pid is located at/var/snap/docker/471/run/docker/containerd/containerd.pid.This pid didn't exist. But the file was not deleted when the server was unceremoniously shutdown. Deleting this file allows the containerd process to start again, and probl... |
Docker toolbox with Visual studio - Volume sharing is not enabled | I'm trying to get running a docker support with Visual studio 2017 for a .net core 2.0 web app running on linux containers. I'm working on machine with win 7 OS, so I must use a Docker toolbox with Virtual box. I've already checked this question:How to get docker toolbox to work with .net core 2.0 project, but I got st... | Finally I got this running. Error message comming from VS is very misleading and it has nothing to do with volume sharing. Eventually I realized that problem is in running a debugger, because when I ran solution withCtrl+F5everything was ok and container started correctly. Problem occurred only when running withF5and t... |
Using {{.Task.Slot}} in Docker volumes | I would like to mount individual volumes to each replica of my Docker service using the{{.Task.Slot}}syntax:services:
foo:
...
volumes:
- type: volume
source: foo{{.Task.Slot}}
target: /mnt
deploy:
mode: replicated
replicas: 3
volumes:
foo1:
...
foo2:
...
f... | This is the correct way to do it:services:
foo:
...
volumes:
- foo:/mnt
deploy:
mode: replicated
replicas: 3
volumes:
foo:
name: 'foo-{{.Task.Slot}}'
...Scaling the service will then create the volume(s) as needed.All credits go to @larsks. |
Remote debug Spring Boot application | I've a simple (dockerized) Web Application in Spring Boot.The App compile correctly.
The container build fine without errors.
The App is running fine on localhost:8080, It's a simple "Hello World".Now I'm trying to attach Spring Tool Suite debugger to the containerized JVM with Remote debugging but without success.The ... | tl;dr:The incorrect part isaddress=127.0.0.1:8000it should be0.0.0.0:8000Full command in the docker compose:command: java -agentlib:jdwp=transport=dt_socket,server=y,suspend=n,address=0.0.0.0:8000 -jar gs-spring-boot-docker-0.1.0.jarLong answer:Every container has its own network interface, keeping that in mind127.0.0.... |
Private docker registry authentication in aws ecs optimized AMI is not successful | I am writing a terraform script for creating a ECS auto scaling cluster.
I have created a cluster and added ec2 container instances in to it.My task definition file contains a image that is from a Private docker repository.I go through the aws official documentation and find a page forPrivate Registry Authenticationand... | when I try to pull the image manually I shows me an error that no image foundThe method you're following provides private registry credentials to the ECS Agent, but not the Docker CLI (the Docker CLI stores its credential data in a different place). Since you've configured credentials for the Agent, you should be able... |
Docker images disappearing over time | I loaded some docker images runningdocker load --input I can then see these images when executingdocker image lsAfter a while images start disappearing. Every few minutes there are less and less images listed. I did not run any of images yet. What could be the cause of this issue?EDIT: This issue arises with docker ins... | Since you've mentioned thatDockerdaemon runs insideminikubeVM, I assume that you might hit K8sGarbage collectionmechanism, which keeps system utilization on appropriate level and reduce amount of unused containers(built from images) by adjusting the specific thresholds.These evictionthresholdsare fully managed byKubele... |
dockerfile is not creating directory and copying files? | I have the following in my dockerfile. (There is much more. but I have pasted the relevant part here)RUN useradd jenkins
USER jenkins
# Maven settings
RUN mkdir ~/.m2
COPY settings.xml ~/.m2/settings.xmlThe docker build goes through fine and when I run docker image, I see NO errors.but I do not see.m2directory created... | I tried something similar and gotStep 4 : RUN mkdir ~/.m2
---> Running in 9216915b2463
mkdir: cannot create directory '/home/jenkins/.m2': No such file or directoryyour useradd is not enough to create /home/jenkinsI do for my user ggRUN useradd -d /home/gg -m -s /bin/bash gg
RUN echo gg:gg | chpasswd
RUN echo 'gg ALL=... |
Docker DNS settings | I try create docker container with custom network and dos settings.docker network create --driver=bridge --opt "com.docker.network.bridge.enable_ip_masquerade"="true" --opt "com.docker.network.bridge.enable_icc"="true" --opt="com.docker.network.driver.mtu"="1500" --opt="com.docker.network.bridge.host_binding_ipv4"="0.0... | As of Docker 1.10, DNS is managed differently for user-defined networks. DNS for the default bridge network is unchanged for backwards compatibility. In a user-defined network, docker daemon uses the embedded DNS server. According to the documentation found here:https://docs.docker.com/engine/userguide/networking/co... |
Can't install scipy | I am trying to installscipyfrom aDockerfileand I cannot for the life of me figure out how.Here is theDockerfile:FROM python:3.5
ENV HOME /root
# Install dependencies
RUN apt-get update
RUN apt-get install -y gcc
RUN apt-get install -y build-essential
RUN apt-get install -y zlib1g-dev
RUN apt-get install -y wget
RUN a... | You're using Python 3 but installing the Python 2 packages. Change yourDockerfileto the following:FROM python:3.5
ENV HOME /root
ENV PYTHONPATH "/usr/lib/python3/dist-packages:/usr/local/lib/python3.5/site-packages"
# Install dependencies
RUN apt-get update \
&& apt-get upgrade -y \
&& apt-get autoremove -y \... |
Why does iconv returns empty string in php:7.4-fpm-alpine docker | Given the following code:<?php
$mb_name = "湊崎 紗夏";
$tmp_mb_name = iconv('UTF-8', 'UTF-8//IGNORE', $mb_name);
if($tmp_mb_name != $mb_name) {
echo "tmp_mb_name: {$tmp_mb_name}\n";
echo "mb_name: {$mb_name}\n";
exit;
} else {
echo "no problem!\n";
}I tested in3v4l.organd it outputsno problem!However, inphp... | Adderror_reporting(-1);and you'll see:Notice: iconv(): Wrong charset, conversion from 'UTF-8' to 'UTF-8//IGNORE' is not allowed in /test.php on line 5Because apparentlythe alpine images just don't work properly with iconvandthe maintainers have simply given up on actually fixing it. I think that it is important to note... |
dial tcp 127.0.0.1:8000: connect: connection refused golang docker containers | I am trying to make an http request from one project to another both using GO. The project that is making the request has the following dockerfile:FROM golang:alpine as builder
WORKDIR /build
COPY . .
RUN CGO_ENABLED=0 GOOS=linux go build -a -installsuffix cgo -ldflags '-extldflags "-static"' -o main .
FROM scratch
WOR... | Expanding on my comment. Your client code's network address will not work:resp, err := http.Post("http://localhost:8000/orders", "application/json", bytes.NewBuffer(requestBody)) // brokenas it is literally talking to itself (localhostrefer to theclientdocker container -notthe host OS).The quickest way - for testing pu... |
docker-compose variable substitution / interpolation with list, map, or array value | How can I use variable substitution for a list, map, or array value in adocker-compose.ymlfile.For example:graylog:
image: graylog2/server2
extra_hosts: ${EXTRA_HOSTS}andexport EXTRA_HOSTS="['host1:10.10.10.1','host2:10.10.10.2']"gives the following error:graylog.extra_hosts must be a mappingI've tried different va... | At least as of this time (June 2018), Docker still doesn't support this. I was able to work around the issue utilizingenvsubst.envsubstis part ofgettextand it can be used to replace only environment variables you tell it to.Tweak thedocker-compose.ymlvalue to look like an array or map (either brackets or curly braces) ... |
How to make a docker container communicate with the localstack docker container with docker-compose? | I am setting up an application inside a docker container. I want this application to be able to connect with the localstack stack containerlocalstack docs. When i rundocker-compose upthe containers start up successfully. I can run a seperate java application not included with in docker-compose file that will connect su... | Regarding this errorConnect to localhost:4576 [localhost/127.0.0.1] failed: Connection refused (Connection refused)Seems you have the setting ready in servicejc, you need the same for your problem application.links:
- localstackI guess your application is running in another docker as well, not on host directly. So you... |
How to execute mysqldump command from the host machine to a mysql docker container | I want to create mysql dumps for a database which is running in docker container. However I do not want to get into the container and execute the command but do it from the host machine. Is there a way to do it. I tried few things but probably I am wrong with the commands.docker exec -d mysql sh mysqldump -uroot -pSome... | This worked on my end(just replace the container ID):docker exec 1d3595c0ce87 sh -c 'mysqldump -uroot -pSomePassword DBName > /dumps/MyNewDump.sql'
mysqldump: [Warning] Using a password on the command line interface can be insecure. |
can't connect to redis through node app, both in dockers | I'm trying to connect my app to redis, but i get:[ioredis] Unhandled error event: Error: connect ECONNREFUSED 127.0.0.1:6379when i do:docker exec -it ed02b7e19810 ping test_redis_1i've received all packets.also the redis container declares:* Running mode=standalone, port=6379* Ready to accept connections( i get the WA... | For that specificdocker-compose.ymlthere is noredison127.0.0.1, you should useredisas host, since services on the same Docker network are able to find each other using the service names as DNS.const Redis = require('ioredis');
const redis = new Redis({ host: 'redis' });Furthermore,depends_ondoes not wait forrediscontai... |
Django + docker + periodic commands | What's the best practices for running periodic/scheduled tasks ( like manage.py custom_command ) when running Django with docker (docker-compose) ?f.e. the most common case -./manage.py clearsessionsDjango recommends to run it with cronjobs...But Docker does not recommend adding more then one running service to single ... | I ended up using this project - Ofeliahttps://github.com/mcuadros/ofeliaso you just add it to your docker-composeand have config like:[job-exec "task name"]
schedule = @daily
container = myprojectname_1
command = python ./manage.py clearsessions |
How to run a SonarQube analysis of .NET Core solution in a Linux container? | I would like to run SonarQube analysis in a Linux container usingtheir new supportfor dotnet global tools. I wonder though where is configuration (server URL, user credentials) located in such case? | This works for me nicely:FROM microsoft/dotnet:2.1.300-sdk
RUN apt-get update && apt-get install -y openjdk-8-jre
RUN dotnet tool install --global dotnet-sonarscanner --version 4.3.1
COPY SonarQube.Analysis.xml /root/.dotnet/tools/.store/dotnet-sonarscanner/4.3.1/dotnet-sonarscanner/4.3.1/tools/netcoreapp2.1/any/Sona... |
How to access phpmyadmin on DDEV Windows 10 pro localhost with SSL record too long error | I am using DDEv and Docker with Windows 10 pro to set up a localhost install of drupal 8.8 using Composer. I have set up and configured the local drupal installation (it is a fresh install) and it appears to be running correctly, but in the admin section of the drupal site I receive a warning to change write permission... | Update 2023-11-29: DDEV uses the ddev-phpmyadmin add-on, and has had https support for PHPMyAdmin for years now,ddev describewill show you the URL. As explained below by @HEYDANNY, you install PhpMyAdmin withddev get ddev-phpmyadmin && ddev restartand can launch it withddev phpmyadmin, and it works fine with https. |
Failed to setup kubeconfig when starting minikube | I have installedkubectlandminikubeon my windows environment, but when runningminikube startit creates the VM on vitualBox but I got this error when it trying to prepare kubernetes on Docker.C:\Users\asusstrix>minikube start
* minikube v1.6.0 on Microsoft Windows 10 Home 10.0.18362 Build 18362
* Selecting 'virtualbox' ... | According to the official documentation:To confirm successful installation of both a hypervisor and Minikube,
you can run the following command to start up a local Kubernetes
cluster:minikube start --vm-driver=For setting the --vm-driver with minikube start, enter the name of the
hypervisor you installed in lower... |
How to deploy asp.net application to docker container on Linux server? | I have installed docker engine on a Linux server. On my desktop's Visual Studio 2015, I created an asp.net application. Now I want to publish it to the Linux server and create a docker image.I followed thisstep.I don't have an azure account and I want to use my own Linux server. So next, I clicked theDocker Containers.... | Visual Studio can't find thedockercommand on your local computer. It needs this as a client to connect to the docker daemon on your Linux server. The easiest way to do this is to install Docker Toolbox from here:https://www.docker.com/products/docker-toolboxYou may have to uninstall and re-install "Visual Studio 2015... |
Symlink command in Dockerfile doesn't create the link in the container | In my Dockerfile I have this line:RUN ln -s /var/www/html/some_file /var/www/html/another_fileWhen running docker build all the steps are executed including the creation of the symbolic link, but when I start a container using the image created and check the folder/var/www/html/I don't see the link there.
I tried searc... | TheDockerfile for that image(three and a half years old and not getting any updates!) has the line:VOLUME /var/www/htmlThis will prevent any subsequent RUN instructions from making any changes to that directory, even if it's in a derived image.There's no way to un-VOLUME a directory, so if you need this symlink to exis... |
How to edit a file dynamically in a running docker container | BackgroundI had build a npm server(sinopia) docker image(https://github.com/feuyeux/docker-atue/blob/master/docker-images/feuyeux_sinopia.md), and in the CMD line, it will run the start.sh every time when the container is generated.CMD ["/opt/sinopia/start.sh"]This shell will create a yaml file dynamically.sed -e 's/\#... | With docker 1.3, there is a new commanddocker exec. This allows you to enter a running docker:docker exec -it bash |
Run docker inside of docker on AWS Fargate | I created a task definition on Amazon ECS and want to run in with Fargate. I set up my task, network mode is awsvpc. I created a new container with a docker image (simple "Hello world" project) on Amazon ECR. Run the task - everything works fine. Now I need to run a docker container from hub.docker.com as a part of the... | You can't run a container from another container using Fargate.
Running a container from another one, like in your case, would mean that you could have access to the docker daemon. Accessing the docker daemon means root access to the host machine. This breaks the docker container isolation and is unsafe.Depending on yo... |
fig docker monitoring broken container | I have a fig configuration for launchNdockers containers (app, redis, mongo, postgre, etc...)When I runfig upeverything is ok.Name Command State Ports
--------------------------------------------------------------------------
my_mongodb_1 /usr/local/bin/run Up 28017... | You have to configure each program (container) in different files and them must be into/etc/supervisor/conf.d/folder, in where the supervisor should look for the programs. In your case I propose:#It is the /redis.conf
[program:redis]
command= /bin/bash -c "fig up redis"
"fig logs redis"
directory=/path/of/fig... |
Stop a failing container with restart=always | I would like to stop a container which is failing to restart (it is in statusRestarting). The container hasrestart=always. Doing:docker stop seems to succeed (no error message), but the container is restarted anyway. The same command actually stops containers withrestart=alwayswhich have restarted normally.If I try to ... | You can first change therestart policywithdocker container update:docker container update --restart="no" and then continue with:docker container stop Restart policies (--restart):no: Do not automatically restart the container when it exits. This is the default.on-failure[:max-retries]: Restart only if the container exi... |
Dns.GetHostAddressesAsync: Resource temporarily unavailable | First, for some context: I am using .NetCore to develop an API with Identity. Everything is on a Cloud server, inside a Docker. When a user is created, an email is sent to the new User using a mailkit and the webmail server through Plesk (Hosted on the same machine). The docker is accessed via a redirection trough Apac... | After two weeks of research, I finally stumbled upon a solution for this:The problem is related to the network, that was obvious, but it's precisely about how containers are isolated from one another. Problem is, the container has no outbound connection. A solution that work inside a standalone container is to use the-... |
Is it possible to launch privileged docker containers on Amazon elasticbeanstalk? | I have tried numerous different ways to include the privileged flag in my task definition per the task definition documentation here:http://docs.aws.amazon.com/AmazonECS/latest/developerguide/task_definition_parameters.html#container_definition_securityI have also found forum postings over at amazon here:https://forums... | Just figured out how to solve this, nowElastic Beanstalk supports running a privileged containersand you just need to add the"privileged": "true"to yourDockerrun.aws.jsonas the following sample (please take a look at thecontainer-1):{
"AWSEBDockerrunVersion": 2,
"containerDefinitions": [{
"name": "container-0",... |
How does "volumes" override the docker image's original files with docker-compose? | Let's use thisdocker-compose.yml:version: '2'
services:
db:
image: mysql:5.7
volumes:
- ./mysql:/var/lib/mysql # <- important
restart: always
environment:
MYSQL_ROOT_PASSWORD: somewordpress
MYSQL_DATABASE: wordpress
MYSQL_USER: wordpress
MYSQL_PAS... | Bind mounts with that syntaxalwaysoverwrite the files that are present in the image. This acts the same way as the normal Linuxmount(8) command: if you mount something like a USB disk over part of your source directory, the contents of the mounted device hide what was originally in the filesystem, and all reads and wr... |
Copy ffmpeg bins in multistage docker build | I'm trying to install ffmpeg via a multistage docker buildHere is the ffmpeg image that contains the ffmpeg binariesFROM jrottenberg/ffmpegHere is the pm2 image that I need to run my web serverFROM keymetrics/pm2:8-alpineI copy the bins into the current image, and I can see that ffmpeg, ffserver, and ffprobe all exist ... | I've had a similar issue and ended up building my own binaries with no dependencies using the alpine gcc toolchain that supports building "static" PIE binaries. The reason was that I wanted no dependencies, hardened build and also support ASLR.https://hub.docker.com/r/mwader/static-ffmpeg/ |
Keep a self hosted servicestack service open as a docker swarm service without using console readline or readkey | I have a console application written in C# using servicestack that has the following form:static void Main(string[] args)
{
//Some service setup code here
Console.ReadKey();
}This code works fine when run on windows as a console. The implementation is almost exactlyhttps://githu... | Stealing fromthis answer for keeping .NET apps alive, you can wait without usingConsolewhich means you don't need to keep stdin open in Docker (docke run -i) :private ManualResetEvent Wait = new ManualResetEvent(false);
Wait.WaitOne();Docker will send a SIGTERM ondocker stopand a ctrl-c will send aSIGINTsothose signals... |
SQL Server named instance in Docker | How can I run a named SQL Server instance inside a Docker container?I have an application that has a connection string pointing to a named SQL Server instance, something likeData Source=HostName\InstanceName; this connection string is very problematic for me to change. I want to dockerize that SQL Server instance. I al... | Docker containers do not support named instances; this is mentionedhere:There is no concept of a named instance. Every container can have a unique name....Containers don't have a concept of running multiple SQL Server instances. So there is no option of running more than one instance name.Really, you should change the ... |
Maintain the media files after build with Docker Container - Django | I am using Django as a Web Framework. Azure NGINEX as WebServer. My Project is deployed with Docker Containers.In my Django project root structure will be as follows:root:
- app1
- app2
- mediawhenever saving images, it will correctly save under media folder. But whenever doing "docker-compose up" it will replace... | As mentioned in the previous answer, this isn't a best practice to handle media and static inside your project or app directory rather you can use a file or file storage server. But I am trying to give the answer to your question here.Suppose you have a Django project directory namedrootand inside this, you are managin... |
Get memory limit in docker file? | Is it possible to get the max memory of a docker container at runtime?What I want to achieve is:docker run --memory "100m"and access the max memory in the docker file:ENTRYPOINT ["java", "-Xmx$memory", "-jar", "helloworld.jar"] | Don't think you can specify memory constraints in the Dockerfile yet. So the way to do it is to override yourentrypointat the command line:$ docker run -i -t --memory "100m" --entrypoint "java -Xmx`cat /sys/fs/cgroup/memory/memory.limit_in_bytes` -jar helloworld.jar" example/java-hello |
Docker python requests results in DH KEY TOO SMALL error | I'm trying to setup a python script that uses the requests library to get data from a website. The script works without issues running in a virtual environment on my windows 10 pc or on a azure vm.However, when I try to create a docker container using thepython:3.6-slimimage I get DH_KEY_TOO_SMALL errors. Testing the w... | I've managed to fix the issue. The problem was caused by openssl versions. Both my windows 10 pc and ubuntu 18.04 vm run an older version that had no problem connecting to the website. The python docker images contain a newer version of openssl that refused to connect. |
Using xdebug through Docker container in PhpStorm | I've read some posts about this but none helped in my case or simply overlooked the missing piece.I cannot get xdebug to work on PhpStorm using a Docker container.Docker-compose.ymlversion: '2'
services:
web:
image: nginx:latest
volumes:
- .:/usr/share/nginx/html
- ./nginx/nginx.conf:/etc/nginx/nginx... | Ok I got the solution in herehttps://forums.docker.com/t/ip-address-for-xdebug/10460/9I had to set my internal ip toxdebug.remote_hostand disablexdebug.remote_connect_back=0Seems this is a osx thing.
Hope this helps someone here |
VS2019 Docker support and Dockerfile failing | VS2019, created a brand new mvc app with Windows Docker support.Dockerfile contents (created from template):FROM mcr.microsoft.com/dotnet/core/aspnet:2.2-nanoserver-1809 AS base
WORKDIR /app
EXPOSE 80
FROM mcr.microsoft.com/dotnet/core/sdk:2.2-nanoserver-1809 AS build
WORKDIR /src
COPY ["mvc1.csproj", "mvc1/"]
RUN dot... | I had the same problem. This links solved my problem:https://improveandrepeat.com/2019/09/how-to-fix-network-errors-with-docker-and-windows-containers/My default Ethernet Adapter didn't have the lowest metric
Check with:Get-NetIPInterface -AddressFamily IPv4 | Sort-Object -Property InterfaceMetric -DescendingSet with:S... |
Locate Dockerfile given image | I am working on a Linux machine. I built a Docker image around 3-4 weeks ago but I don't remember where the Dockerfile is located.What's the best way to locate the Dockerfile? Is it possible to somehow get its location given the image?I tried using:$ docker image inspect but it does not show this information. | Docker image doesn't store any information on Dockerfile, but you can try to reverse engineer it. There's few approaches to that:Usedocker history --no-trunc, it will display information on each layer:> docker history golang:1.14.2-alpine3.11 --no-trunc --format="{{.CreatedBy}}"
/bin/sh -c #(nop) WORKDIR /go
/bin/sh ... |
.Net Core Linux Container Won't Connect to SQL Server Using SQL Authentication | A .Net Core 2.2 application running in a Linux Docker container fails to authenticate to SQL Server on a different machine using SQL Authentication. The error message is:Cannot authenticate using Kerberos. Ensure Kerberos has been initialized on the client with 'kinit' and a Service Principal Name has been registered f... | It turns out that the connection string in the base appsettings.json configuration file was not being overwritten by the environment-specific settings file (appsettings.Development.json). Our DevOps group set the environment variable for the container and it correctly connected using the SQL Server credentials. |
Mount repo into docker image when running yaml-pipeline in Azure DevOps | I am running a docker image in Azure Devops yaml-pipeline using acontainer step. However, I have problems mounting the content of the repo so that this is accessible from inside the docker image.The Azure Devops pipeline.yml file is as follows:container:
image: 'image-name'
endpoint: 'foo'
options: '-v $(Build.So... | Any ideas how to accomplish this? Or do I need to create a new docker
image where the repo files have been add:ed?When specifying theContainerusing Yaml Schema directly, the Azure DevOps Service will call an extraInitialize containerstask automatically beforecheckout source repotask and your real tasks.container:
i... |
How can I run a Docker Hub container on Heroku via app.json? | I want to create a 'Deploy to Heroku' button for an open source project. When the button is clicked, I want Heroku to deploy the latest image from Docker hub. How can I achieve this via myapp.jsonmanifest?Theapp.json schemaallows me to set"stack": "container"to specify that I want to run a container, yet all I have bee... | The only way you could do this would be by having aDockerfile.herokufile which contains:FROM Then, inheroku.yml:build:
docker:
worker: Dockerfile.herokuWith this process, Heroku will always build from source. But it will do so by pulling the image from DockerHub, discarding everything else.There is no way to use... |
How to upload a file from a Docker container that runs on Fargate to S3 bucket? | I have a containerized project, the output files are written in the local container (and are deleted when the execution completes), the container runs on Fargate, I want to write a Python script that can call the model that runs on Fargate and get the output file and upload it to an S3 bucket, I'm very new to AWS and D... | You need to executeS3 Copy commandvia AWS CLI or it's equivalent inBOTO3 Python client.$aws s3 cp /localfolder/localfile.txt s3://mybucketOr equivalent in Python:import boto3
client = boto3.client('s3')
response = client.put_object(
Body='c:\HappyFace.jpg',
Bucket='examplebucket',
Key='HappyFace.jpg'
)
p... |
Docker - Node.js + MongoDB - "Error: failed to connect to [localhost:27017]" | I am trying to create a container for myNodeapp. This app usesMongoDBto ensure some data persistence.
So I created thisDockerfile:FROM ubuntu:latest
# --- Installing MongoDB
# Add 10gen official apt source to the sources list
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10
RUN echo 'deb ht... | Do you actuallydocker run aldream/myApp? In that case, with the Dockerfile that you provided, it should run MongODB, but not your app. Is there anotherCMDcommand, or another Dockerfile, or are you runningdocker run aldream/myApp ? In the latter case, it will override theCMDdirective and MongoDB will not be started.If y... |
Exposing multiple ports from within a ManagedVM | I'm using the Managed VM functionality to run a WebSocket server that I'd like to expose to the Internet on any port (preferably port 80) through a URL like: mvm.mydomain.comI'm not having much success yet.
Here are the relevant parts of various files I'm using to accomplish this:Dockerfile:EXPOSE 8080 8081At the end o... | It may very well be that port forwarding fromappspot.comisn't performed, given that prior to the (relatively recent) release of managed VMs, the only traffic that went toappspot.comwas on port 80 or 443. I'd suggest using the IP-of-instance method you found to work.If you don't find that fully satisfying, you should go... |
Is there any way to run an image Windows Docker on Ubuntu? [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, ... | FromDocker success center:At this time, no, Docker for Windows Server 2016 does not support GUI-based applications. This is because Windows containers are based on either Nano or Core Server, which do not allow users to start up a GUI-based interface nor RDP into the container.And concerning running Windows containers ... |
Docker Swarm and private IP | When I launch an app via docker I can publish the app on a port specifying the IP.Suppose that my server has two ip (private 192.168.0.2 and public 200.168.0.2), I can expose an app on the private ip with this command:docker run -it -p 192.168.0.2:80:80 nginxHow can I achieve something similar with docker swarm?I gues... | Swarm doesn't give the option to listen on a specific interface, it defaults to listen on all interfaces. This is anopen issue. Modifying overlay networks inside of docker will not change this behavior. |
AWS Elastic Beanstalk - how to stop previous docker before starting new one | I have a set of AWS Elastic beanstalk using Docker based configuration for both web server and worker server. The way we have setup is that the java process inside docker allocates 70% of the box memory when starting.Now the first deployment works fine, but when I try to update application version with in-place Rolling... | immutable updates can be the way to go for you, it basically recreates the EC2 instances completely on every deployOpen the Elastic Beanstalk console.Navigate to the management page for your environment.Choose Configuration.In the Rolling updates and deployments configuration category,
choose Modify.Select immutable on... |
Python getting Docker Container Name from the inside of a docker container | I need to get the containers name, from within the running container in pythoni could easily get the container id from inside the container in python withbashCommand = """head -1 /proc/self/cgroup|cut -d/ -f3"""
output = subprocess.check_output(['bash','-c', bashCommand])
print outputnow i need the containername | Just set the Name at runtime like:docker run --name MYCOOLCONTAINER alpine:latestThen:bashCommandName = `echo $NAME`
output = subprocess.check_output(['bash','-c', bashCommandName])
print output |
Docker container build faild: "exec: \"flask\": executable file not found in $PATH": unknown | I'm learning docker. I try run a sample dockerfile on docker,com. But I have a problem is "Error response from daemon: OCI runtime create failed: container_linux.go:345: starting container process caused "exec: \"flask\": executable file not found in $PATH": unknown
".FROM python:3.7-alpine
WORKDIR /code
ENV FLASK_APP... | Seems likeflaskis not found from the PATH. It is either not installed (is it in requirements.txt?), or just not added into path.You could try to setCMD ["python", "-m", "flask", "run"]instead.Edit: Example here works for me well.https://docs.docker.com/compose/gettingstarted/You could try to pass--no-cacheoption to jus... |
List files in exited container | Is there an easy way to check what files were produced after container exits?I saw recommendations to rewriteDockerfileand addlscommands to it, but that's not the easy way for me.UPDATE: I was usingVOLUMEdirective insideDockerfileanddocker diffdoesn't show changes there. | You can usedocker diff container_name. This inspect changes to files or directories on a container filesystem.It shows something like this.A /usr/local/lib/python2.7/email
C /usr/local/lib/python2.7/email/mime
D /usr/local/lib/python2.7/email/mime/audio.pycA: A file or directory was addedC: A file or directory was ch... |
Jenkins Pipeline Across Multiple Docker Images | Using a declarative pipeline in Jenkins, how do I run stages across multiple versions of a docker image. I want to execute the following jenkinsfile on python 2.7, 3.5, and 3.6. Below is a pipeline file for building and testing a python project in a docker containerpipeline {
agent {
docker {
image 'python:... | I had to resort to a scripted pipeline and combine all the stagesdef pythons = ["2.7.14", "3.5.4", "3.6.2"]
def steps = pythons.collectEntries {
["python $it": job(it)]
}
parallel steps
def job(version) {
return {
docker.image("python:${version}").inside {
checkout scm
sh 'pip... |
Docker Nginx: host not found in upstream | I have my docker app running in the aws EC2 instance, and I am currently trying to map the app to the external IP address using Nginx. Here is a snap shot of the containers that I have running:My test-app is a fairly simple app that displays a static html website. And I deployed it using the following command:docker ru... | While your two containers are both running and you have properly exposed the ports required for the NGINX container. You have not exposed any ports for thetest-appcontainer. The NGINX container has no way of talking to it. Exposing ports directly withdocker runwould likely defeat the point of using a reverse proxy in y... |
Docker. Celery and code in different containers | I want to make additional container for celery workers.
So the structure should be the following:celery_container - Celery
code_container - RabbitMQ, DB, code, everything elseI know how to organise a network, so celery is connected to Rabbit in another container.But I can't realize, should I keep my code in both contai... | As I understood, the best way is to keep code in both containers, with code and with celery.It's useful to build smth likebase imagewhere will be almost all dependencies and app code. Then you will be able to build container with code and celery from this container. So if you'll need to build any other container with c... |
Unable to install suggested plugins of jenkins on docker | I had launched jenkins through docker, it has been launched in administrator mode. After entering password when i selected to install suggested plugin it fails with most of the installation. Post that when i created jenkins user and navigated to jenkins home page it displays errors as shown in below screenshot.Installe... | I had the same issue when using thelatest weekly, so I suggest to use theltssince when specifyjenkinsin your command you are pullinglatest weeklyrun your command like this:docker pull jenkins/jenkins:lts
docker run -p 8080:8080 jenkins/jenkins:ltsseejenkins |
Executable file not found in $PATH | I am working in a Dockerfile for PHP-FPM 7.1. I am ending the Dockerfile with the following line:CMD ["php71-php-fpm"]Because I am usingdocker-composethis is how I start up the container:docker-compose up -dThe container compiles fine (apparently) as per this lines:Successfully built 014e24455b53
WARNING: Image for ser... | I believe you're running into trouble because the default shell run by Docker is not a login shell according tothis answer, which means scripts in/etc/profile.d/don't get processed.If you need profile processing, try changing your last line toCMD ["/bin/sh", "-l", "-c", "php71-php-fpm"]to invoke a login shell. |
Building two differently tagged docker images with docker-compose | I am currently on the way to deploying a Java application with Docker and K8s. As I am using a Raspberry Pi Kubernetes Cluster I want to generate two images, one for the x86 platform, and one for the arm32v7 (for testing on the Raspberry cluster). The goal is to generate two differently tagged docker images with one Do... | For anyone wondering, I figured it out with a little help.The target definiton inside the build part of the docker-compose.yml is NOT to define the target image. It defines the target stage. To specify a image add the image portion to the multiple stages. Also no blank lines between the commands inside the Dockerfile, ... |
EC2 Docker container logs on CloudWatch | I have a running container on EC2 instance and I would like to populate my logs to CloudWatch in the same region.I was trying to use this tutorial:https://docs.docker.com/config/containers/logging/awslogs/However I have an issue related with the timeout of connection, also even though policy allows my ec2 instance to c... | If the instance has correct permission all you need to pass the following option to your docker run command.docker run -it --log-driver=awslogs --log-opt awslogs-region=us-west-2 --log-opt awslogs-group=myLogGroup --log-opt awslogs-create-group=true node:alpineYou can check intoaws-console, you will see log group ... |
login password required to access jupyter notebook running in nvidia-docker container | I run this command in the following order in order to run tensoflow in docker container after successful installation in Ubuntu 16.04 (NVIDIA GPU GeFORCE 840M) .1.sudo service docker start
2.sudo nvidia-docker run -it -p 8888:8888 gcr.io/tensorflow/tensorflow:latest-gpuThen I try to access jupyter in firefox browser ... | add option "-e PASSWORD=password" to set the environment variable. The set password is then the password for the jupyter login. |
Docker composed services can't communicate by service name | tldr: I can't communicate with a docker composed service by its service name in order to make requests to an api running in networked containers.I have a single page application that makes requests to a json api. Its Dockerfile looks like this:FROM nginx:alpine
COPY dist /usr/share/nginx/html
EXPOSE 80A build process d... | Since you are using docker-compose.yml version 2, links should not be necessary. Containers within a compose network should be able to resolve other compose containers by service name.Reading the comments on your question it seems like the networking and host name resolution works, so it seems like the problem is in yo... |
Why is the "Build an image" step failing for Docker on Visual Studio Online? | I'm trying to build a Docker image, which seems to build and run fine on my local machine, but it keeps failing with the following error:2018-05-06T13:56:15.2331697Z failed to register layer: re-exec error: exit status 1: output: ProcessUtilityVMImage C:\ProgramData\docker\windowsfilter\3b555fe81a5123419e06c66652d9e73a... | It is not supported on Hosted agent of VSTS, check this issue:Docker images based on nanoserver-1709 not building on hosted VS2017 agent |
Adding interactive user input e.g., `read` in a Docker container | I want to make a Docker image that can perform the following:Get user input and store it in a local variable usingreadUtilize that variable for a later commandUsing that I have the following Dockerfile:FROM ubuntu
RUN ["echo", "'Input something: '"]
RUN ["read", "some_var"]
RUN ["echo", "You wrote $some_var!"]which, wh... | One solution is touse an external shell scriptand useENTRYPOINT.Contents ofrun.sh:#!/bin/bash
echo "Input something!"
read some_var
echo "You wrote ${some_var}!"Contents ofDockerfile:FROM ubuntu
COPY "run.sh" .
RUN ["chmod", "+x", "./run.sh"]
ENTRYPOINT [ "./run.sh" ]This will allow./run.shto run when the container is ... |
Docker compose mapping local directory to dockerfile volume | I'm using an Apache / MySql Docker-compose set up which is all good. However the issue comes when, as this is for local development, the web container points to a local folder, for which I need Apache to have permissions to.UsingRUN mkdir /www \
&& chown -R apache:apache /www
VOLUME ["/www"]is fine if I run the Apache... | Docker for Windows uses a CIFS/Samba network file share to bind-mount host files into the Linux VM running docker. That is always done asroot:rootso all bind-mount files/dirs will always show that when seen from inside container. This is aknown limitation of the way docker shares these files between the OS's.Workaround... |
Create custom Neo4j Docker image with intial data from cypher file | I tried create an docker image of neo4j that already provide some data, when you start an container. For my approach I inherited from the neo4j docker image, added some data via the neo4j cypher shell. But when i build the image and run a container from it the data did not appear in the database but the custom password... | I was usingBierbarbar's approach. I got it working after getting over the following two pitfalls:Firstly,$NEO4J_HOME/datawas symlinked to/data, which seem to have permission issues. Changing the default data folder: by addingdbms.directories.data=mydataline to$NEO4J_HOME/conf/neo4j.conffixed this.Secondly, make suredat... |
How to disable Nginx caching when running Nginx using Docker | I use the official nginx docker image (https://registry.hub.docker.com/_/nginx/). When I modify the Index.html I don't see my change. Settingsendfile offin nginx.conf didn't help.I only see the change if i rebuild my image.Here is my Dockerfile:FROM nginx
COPY . /usr/share/nginx/html
COPY nginx/nginx.conf /etc/nginx/ng... | It's not caching. Once a file is copied into a container image (using theCOPYinstruction), modifying it from the host will have no effect - it's a different file.You've attempted to overwrite the file by bind-mounting a volume from the host using the-vargument todocker run. This will work - you will now be using the sa... |
Docker returning exit code 3221225781 installing vc_redist.x64.exe | I have seen lots of questions about exit code '3221225781' in response to docker RUN, but I am unable to find an answer still. Consider this dockerfile:FROM mcr.microsoft.com/dotnet/core/runtime:3.1
WORKDIR /app
ADD https://aka.ms/vs/16/release/vc_redist.x64.exe vc_redist.x64.exe
RUN VC_redist.x64.exe /install /quiet /... | I think I figured this out. It seems like the image 'mcr.microsoft.com/dotnet/core/runtime:3.1.1' is just a "layer" which only contains the recipe needed to install the runtime, but doesn't contain the underlying OS specification (please correct me if that is wrong). Therefore, I first need to provide the OS, and insta... |
Does it make sense to run multiple similar processes in a container? | a brief background to give context on the question.Currently my team and i are in the midst of migrating our microservices to k8s to lessen the effort of having to maintain multiple deployment tools & pipelines.One of the microservices that we are planning to migrate is an ETL worker that listens to messages on SQS and... | You should absolutely restructure this to run one process per container and one container per pod. You do not typically need an init system or a process manager like supervisord or runit (there is an argument to have a dedicated init liketinithat can do the special pid-1 things).You mention two concerns here, restarti... |
Cleaning up orphaned docker containers after Jenkins job is terminated | I work at a large organization that runs hundreds of jobs in a shared Jenkins cluster.My Jenkins job needs to run integration tests against untrusted code running inside Docker containers. I am fearful that that when my Jenkins job gets terminated abruptly (e.g. job aborted or times out) I will be left with orphaned co... | By the looks of things, people are handling this outside of docker.They are adding Jenkins post-build steps that clean up orphaned docker containers on aborted or failed builds.See Martin Kenneth'sbuild scriptas an example. |
How to specify commandline arguments to a docker container in Azure Service Fabric | I've a docker imagewiremock.net-nanowhich accepts additional commandline parameters like--Portand--AdminUsername.The normal docker commandline looks like:docker run --rm -p 9091:80 sheyenrath/wiremock.net-nano --ReadStaticMappings true --AdminUsername x --AdminPassword y --RequestLogExpirationDuration 24But how can I c... | If I am not mistaken the/in the element is what you are looking for.As perServiceManifest.xmlschema:Pass a comma delimited list of commands to the container.The schema excerpt:
The repo and image on https://hub.docker.com or Azure Container Registry.
Pass a comma delimited list of commands to the container.
... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.