Prompt stringlengths 14 160 | Instruction stringlengths 18 2k | Response stringlengths 8 2k |
|---|---|---|
Drone CI does not see secret variables when using drone-email plugin | I'm usingdrone-ci(0.8.0-rc.5) as CI tool anddrone-emailplugin for sending emails. I would like to send notifications if a build succeeded or failed. I use the Gmail SMTP server for sending emails.My .drone.yml file:notify:
image: drillster/drone-email
host: ${EMAIL_HOST}
port: ${EMAIL_PORT}
username: ${EMAIL_US... | The syntax you are using,${secret}, was deprecated in drone 0.6 and replaced with the following syntax:pipeline:
notify:
image: drillster/drone-email
from:[email protected]recipients: [[email protected]]
secrets: [EMAIL_HOST, EMAIL_PORT, EMAIL_USERNAME, EMAIL_PASSWORD]The above syntax instructs drone to p... |
Cannot access port on host mapped to docker container port | I have started a docker container using the commandsudo docker run -it -P -d plcdimageThe image is built using a Dockerfile which has instruction EXPOSE 8080. Container runs a jboss server with an application deployed on it. Port mappings are :Command: sudo docker port be1837e849dc
Output: 8080/tcp -> 0.0.0.0:32771Whe... | I found that jboss server running inside the container was not listening on 0.0.0.0. One option to do this is, while starting the standalone server use -b 0.0.0.0./bin/standalone.sh -b 0.0.0.0 |
How fix nginx error "invalid number of arguments"? | i try redirect to proxy-server nginx.location /phpmyadmin {
proxy_http_version 1.1;
proxy_pass https://${PMA}:5000/;
proxy_set_header Host $host;
proxy_set_header X-Real-IP $remote_addr;
}But i get error:nginx: [emerg] invalid number of arguments in "proxy_set_header" directive ... | I used envsubst for environment replacing, and this util tried swap $host and other nginx envs, solved with:envsubst '$WP $PMA' < nginx.template.conf > nginx.ready.conf; rm nginx.template.confThis will replace only the$WPand$PMAvariables in the nginx.template.conf file and write the output to nginx.ready.conf. Avoiding... |
Mesos task - Failed to accept socket: future discarded | I am just trying to upgrade mesos version to 1.3.1 from 1.0.3.Chronos scheduler is able to schedule the JOB thru mesos. The job runs fine and able to see mesos stdout logs. But, still seeing the following in mesos stderr logs. The docker jobs runs fine, but still the status is showing as failed with the below logs.I09... | Do not worry. This line was introduced in 1.3 byr/58557/and will be fixed in 1.4This log line is not usually a problem, and reporting it as an error can
cause needless debugging.r/59817 |
I need to remove a deleted network from a docker container | I'm working with docker on a local machine (all windows). To allow my containers to access other resources in my Network, i created a new network and gave it the needed routing/gateway info.After restarting my machine to install a VPN (unrelated to my docker containers) the network was gone and all the containers conne... | One possible option to try to recover your data from the container (I'm not 100% sure it can work in your specific case...).Create an image from the stopped container statedocker commit my_stopped_container my_recovery_img:latestDelete the current containerdocker rm my_stopped_containerRecreate the container from the d... |
Can you use nginx reverse proxy to docker containers without exposing any ports? | I'd like to know if it's possible to use nginx with docker compose as an api gateway / reverse proxy / ssl termination point without exposing any ports on the containers behind it. I.e. I want to use only the intranet created by docker compose when the containers are linked to communicate past nginx. Ideally the only p... | Yes is doable.Just define your application in one container and nginx in another container, both in the same docker-compose.yml. Link them. And only expose the 443 port in nginx container.docker-compose.ymlnginx:
image: nginx
links:
- node1:node1
- node2:node2
- node3:node3
ports:
... |
Run shell script inside Docker container from another Docker container? | If I am on my host machine, I can kickoff a script inside a Docker container using:docker exec my_container bash myscript.shHowever, let's say I want to runmyscript.shinsidemy_containerfrom another containerbob. If I run the command above while I'm in the shell ofbob, it doesn't work (Docker isn't even installed inbob)... | Simply launch your container with something likedocker run -it -v /var/run/docker.sock:/var/run/docker.sock -v /usr/bin/docker:/usr/bin/docker...and it should do the trick |
Deploying my Python (FastAPI) Application with Docker: ModuleNotFoundError: No module named 'FolderInStructure' | I am trying to deploy my fastAPI applications using Docker. It's part of a bigger system which I am trying to connect with each other using a docker-compose later on. It works fine locally but when I try deploying it, it doesn't found my sub directories. I have__init__.pyfiles in all directories.This is my project stru... | it surely have something to do with the venv and the path, here is an old fastapi docker combined with your codeFROM python:3.8-slim-buster
ENV PYTHONDONTWRITEBYTECODE=1
ENV PYTHONUNBUFFERED=1
# install system dependencies
RUN apt-get update \
&& apt-get -y install gcc make \
&& rm -rf /var/lib/apt/lists/*s
... |
enable scripting within docker image | I can start elasticsearch with Kibana using the following 2 docker commands...docker run -d -p 9200:9200 -p 9300:9300 --name elasticsearch-pb elasticsearch
docker run -d -p 5601:5601 --name kibana-pb --link elasticsearch-pb:elasticsearch -e ELASTICSEARCH_URL=http://elasticsearch:9200 kibanaBut how do I start es with sc... | Build a custom image that includes those options.Create a directory for your docker imagemkdir my_elasticsearch
cd my_elasticsearchCreate anelasticsearch.ymlwith all the options includingscript.inline: on
script.indexed: onCreate aDockerfilethat copies the config file.from elasticsearch
copy elastcsearch.yml /container... |
Decrypt with gpg from inside a docker container | I have an encrypted file with gpg that I want to decrypt from inside a docker container.
gpg is not found on the container, how would I add it. | Depending on your base image (used by your container), you would need to add to your Dockerfile(or to make one, starting withFROM ) with:RUN apt-get update && apt-get install gnupg(as in thisdocker-vault-init Dockerfile)Then check out "Adding GPG key inside docker container causes “no valid OpenPGP data found”".This co... |
how to compile and build a python package for aarch64 using qemu? | I am trying to build python wheels for a package (lap) for theaarch64architecture. My host environment is WSL2 with Ubuntu 20.04 anddocker. Target is BuildrootGNU/Linux. So no compiler is available on the target. My goal is to setup a cross-build environment foraarch64usingqemu. As described inRun a AArch64 native cont... | All seem to be working fine, but the last step you're not accessing the actual file.Since I don't know docker so well. First I start a aarch64 shell.docker run -it quay.io/pypa/manylinux2014_aarch64 bash[root@637db2c1af5e /]# uname -maarch64Then from inside of the container, I just build the program like I would normal... |
ENTRYPOINT with environment variables is not acepting new params | We are creating a simpleDockerfile, the last line of that file isENTRYPOINT ["sh", "-c", "spark-submit --master $SPARK_MASTER script.py"]Thescript.pyis a simple pyspark app (is not important for this discussion), this pyspark app receives some parameters that we are trying to pass using thedockercommand as followsdocke... | The/bin/sh -conly takes one argument, the script to run. Everything after that argument is a a shell variable$0,$1, etc, that can be parsed by the script. While you could do this with the/bin/sh -csyntax, it's awkward and won't grow with you in the future.Rather than trying to parse the variables there, I'd move this i... |
Internet connection inside Docker container in Kubernetes | I have a Kubernetes pod based on jenkins/slave container to which I mount docker socket and docker binary file with necessary kernel module in privileged mode. Inside that pod I build Docker image basing on which I run docker container. Inside that container I don't have Internet connection at all because pod container... | Not sure if this article will help you with this issue,JENKINS DECLARATIVE PIPELINES WITH KUBERNETES. This article shows a full stack on how to setup Jenkins in Kubernetes and also involves idea about Docker in Docker.Based on my thought, we could mark as pod container ascontainer1and container in pod ascontainer2.I th... |
How to create two postgres database when docker-compose up? | Dockerfile:FROM python:3.9
ENV PYTHONUNBUFFERED=1
RUN apt-get update && apt-get upgrade -y \
&& apt-get install -y gcc gunicorn3 libcurl4-gnutls-dev librtmp-dev libnss3 libnss3-dev wget \
&& apt-get clean \
&& apt -f install -y
WORKDIR /App
COPY requirements.txt /App/
RUN pip install -r requirements.txt
COPY . /App/... | I just createdinit.sqlfile and add it intodocker-entrypoint-init.db, this is how i did. Its better to createpsqlfolder and addinit.sqlfile into it.Remove- POSTGRES_DB=develop_dbthis from the base-compose file and change it.version: '3.3'
networks:
shared_network:
driver: bridge
services:
testdb:
image: pos... |
How to run headless browser inside docker? | I am building a Crawler with headless browser But right now I want to dockerize my app I've installed chrome in my docker image But it throw me an error when run the script.StartChrome.jsconst chromeLauncher = require('chrome-launcher');
chromeLauncher.launch({
port: 9222,
chromeFlags: ['--headless','--proxy-s... | You can try with a Docker Image likeyukinying/chrome-headless-browseror similar:https://hub.docker.com/r/yukinying/chrome-headless-browser/From the description:This docker image contain the Linux Dev channel Chromium
(https://www.chromium.org/getting-involved/dev-channel), with the
required dependencies and the com... |
How to upgrade MariaDB running as a docker container | I have MariaDB 10.1 running in a Docker container and I want to upgrade to 10.2. My data is persisted in a volume which /var/lib/mysql is mapped to, my.cnf, is not mapped and unchanged. What is the correct procedure to end up with a Maria 10.2 container with my data intact?The procedure I considering is as follows:Stop... | MariaDB documentation does have an upgrade from10.1 -> 10.2 documentationthat is worth reading.Although most of it is around package upgrades however there are some notes around an optionalSET GLOBAL innodb_fast_shutdown=0and finishing withmysql_upgrade.Adocker volume inspectto look at the mountpoint and take a copy of... |
Nifi container running but not accessible via UI | I am very new to docker and Nifi so please understand if my question doesn't sound refined.When I downloaded Nifi from official apache nifi website and fired it up, it was accessible via http://localhost:8443/nifiBut when I created a docker container using the following commanddocker run -itd -p 8433:8080 --name nifi a... | By defaultnifilistening only8443port (and using HTTPS connection)If you want to connect using unsecure HTTP, you need to set HTTP port:docker run -itd -p 8443:8080 -e NIFI_WEB_HTTP_PORT=8080 --name nifi apache/nifiIn this case HTTPS connection will be disabled and you will be able to connect withhttp://localhost:8443/n... |
Can't connect to ASP.NET core through docker | Hi people have been looking at this for far too long and need some help.I have made a ASP.NET core website nothing fancy just the template that goes with VS 2017 (v 1.1). I publish the site using dotnet core cli and build an image using this dockerfile:FROM microsoft/dotnet:1.1-runtime
COPY /Publish /dotnetapp
WORKDIR ... | Was a stupid mistake arguments were in wrong orderdocker run -it -p 8444:8444 and it worked :\ |
Command `eval $(minikube docker-env)` vs `Using eval $(minikube -p minikube docker-env)` | I've set up the Docker Engine locally to run on minikube (rather than using Docker Desktop). I know that I need to make sure that the Engine "talks to" the minikube cluster. I've consulted two tutorials, which have slightly different instructions. Specifically for this question, I want to understand the difference betw... | Minikube profiles are a way of getting different isolated environments (VMs), which can be helpful in a handful of scenarios (testing how the application behaves on different networks, testing different K8s versions, etc).By default, theminikube startwill start a VM with a profile namedminikubethat can be referenced th... |
volume not getting mounted in nginx container | I have the below compose file which starts 2 containersservices:
nginx:
container_name: nginx
build: ./nginx/
ports:
- "80:80"
links:
- node:node
volumes_from:
- node
node:
container_name: node
build: .
env_file: .env
command: npm run packageThe dockerfile for... | The node part of your docker-compose.yml doesn't declare any volumes - how should docker know which part of your node image should be shared! Try adding something like this to the node service in your compose yaml:volumes:
- /usr/src/app |
Dockerfile: not able to run bin command ubuntu | Trying to get elasticsearch installed and running into an error here in my dockerfile. Looks like it's unable to run bin.#JDK 1.8 on Ubuntu for ElasticSearch
RUN add-apt-repository -y ppa:webupd8team/java
RUN apt-get -y update
RUN apt-get -y install openjdk-8-jre
RUN wget -qO – https://artifacts.elastic.co/GPG-KEY-elas... | It seems there is an issue installing the keys like that. Similar problemhereandhere.The suggested solution is to split the command like this:wget -q https://artifacts.elastic.co/GPG-KEY-elasticsearch
apt-key add GPG-KEY-elasticsearchIn your case, I suspect the output of thewgetcommand is not theGPGkey. It might be som... |
Dockerfile keytool: getting "Certificate alias <name> already exists" even using "keytool - delete" | I useDockerfileto create an image for our web app which requiresHTTPS. However, I am gettingCertificate not imported, alias already existsJava exception. When I tried without usingDockerfile, just from command line, I was able to delete the existing alias andexport,importworked. But not withDockerfile. Any ideas? Than... | I prefer the notation:RUN cd usr/app/ssl/certs/ && \
keytool -delete -alias my-cert-name -keystore my-cert-name.jks -storepass password123! && \
keytool -export -alias my-cert-name -keystore my-cert-namet.jks \
-file my-cert-name.crt -storepass password123! && \
keytool -importcert -keystore trustStor... |
docker-compose: command not found on jenkins | I have a docker compose fileversion: "3"
services:
mysql:
image: mysql:latest
container_name: locations-service-mysql
environment:
MYSQL_ROOT_PASSWORD: root
MYSQL_USERNAME: root
MYSQL_DATABASE: 'locations_schema'
restart: always
volumes:
- mysql_data:/var/lib/mysql:rw
ph... | Probably yourdocker-composedoesn't exist in your $PATH env variable.First you should remove any conflictingdocker-compose-rm /usr/local/bin/docker-composeOn most of the Linux systems, below is how I prefer installing docker & docker compose -(Run commands as root)curl -fsSL get.docker.com -o get-docker.sh
sh get-docker... |
pip install in Dockerfile is failing [closed] | Closed. This question needsdetails or clarity. It is not currently accepting answers.Want to improve this question?Add details and clarify the problem byediting this post.Closed4 years ago.Improve this questionHi I have created a Dockerfile for my app as below but it failed when I try to build the dockerimage .FROM pyt... | edit yourdockerfile:FROM python:alpine3.7
RUN apk update && apk add --no-cache gcc g++ python3-dev unixodbc-dev
COPY . /app
WORKDIR /app
RUN pip install --upgrade pip
RUN pip install -r requirements.txt
CMD python ./index.pyedit yourrequirements.txtflask
SQLAlchemy
pyodbc
pandas
numpy |
No connection in docker with ports exposed and published | I have some middleware running in a docker container.When I run this middlewareon my host machine everything works fine.When I ran it on thedockercontainer with all the necessaryports exposed and published:Dockerfile:EXPOSE 5672 15672 1337 1338 5556 3000Docker-compose.ymlports:
- "5672:5672"
- "15672:15672"
- "1337:133... | Need to indicate docker it is udp protocol.FROM:-1338:1338TO:- 1338:1338/udp |
Cannot leave swarm mode | I've been tinkering with new Docker swarm mode. I can't fully recall the steps that I did, but now I'm stuck in situation where my docker engine is as a worker in a non-existing swarm:$ docker info
...
Swarm: active
NodeID: 1vndsuqa0r3paswufs7eq4po3
Is Manager: false
Node Address: 192.168.65.2
...
$ docker swarm le... | I finally managed to fix this by resetting docker back to factory defaults fromDocker menu > Preferences > Uninstall / Reset > Reset to factory defaults(I'm using Docker for Mac beta). Note that this operation also swipes all docker images, volumes, networks, etc. |
Docker and -march native | My application benefits greatly from advanced CPU features that gcc can access when it is run with-march native. Docker can smooth over differences in OS, but how does it handle different CPUs? To build an application that can run on any CPU I would have to build for amd64, losing out on a lot of performance. Is there ... | Docker doesn't handle CPU at all. It is just a composition ofkernel namespacing, FS system layering (e.g.UnionFS) andprocess quoting.When you run something on a docker container it is just an executable running onyour OS,without virtualisation, it has access only to a selected set of kernel objects (e.g. devices) and i... |
Telegraf can not connect to Docker sock | I try to gather some metrics about my Docker containers using Telegraf. I have mounted the docker sock to it but I still receive an error message. What am I missing here?volumes:
- ./data/telegraf:/etc/telegraf
- /var/run/docker.sock:/var/run/docker.sock2021-10-29T20:11:30Z E! [inputs.docker] Error in plugi... | The Telegraf Docker images now run the telegraf process as thetelegrafuser/group and no longer as therootuser. In order to monitor the docker socket, which is traditionally owned byroot:docker group, you need to pass the group into the telegraf user.This can be done via:--user telegraf:$(stat -c '%g' /var/run/docker.so... |
uwsgi_pass does not forward SCRIPT_NAME header | I'm trying to make my web app (Django/wsgi-based) available from some subfolder of the main domain.
I'm using docker for my app, and static files, so I have main nginx on my server as reverse proxy, another nginx in "nginx" container which routes the stuff for my app and uWSGI in the second container which serves actua... | There are two problems here.First is that nginx considers headers which contain underscores as invalid, soSCRIPT_NAMEheader is not being accepted by nginx in the container because it's invalid from nginx point of view. Luckily, nginx directiveunderscores_in_headersis here to help.Just addunderscores_in_headers on;toser... |
installation of nodejs returned a non-zero code: 1 with docker build | I'm trying to build a docker image with the following dockerfile:FROM ubuntu:16.10
MAINTAINER Fátima Alves
COPY ./dist /myprogram/
WORKDIR /myprogram
RUN apt-get update \
&& \
apt-get install -y \
curl ... | Have you tried running this yourself to see what the error is? Like so:$ docker run --rm -it ubuntu:16.10
[...]
root@96117efa0948:/# apt-get update
[...]
root@96117efa0948:/# apt-get install -y curl
[...]
root@96117efa0948:/# curl -sL https://deb.nodesource.com/setup_6.x | bash -
[...]
## Your distribution, identified ... |
How to expose a service from minikube to be able to access it from another device in the same network? | I've created a service inside minikube (expressjs API) running on my local machine,
so when I launch the service usingminikube service wedeliverapi --urlI can access it from my browser withlocalhost:port/apiBut I also want to access that service from another device so I can use my API from a flutter mobile application.... | Due to small amount of information and to clarify everything- I am posting a general Community wiki answer.The solution to solve this problem was to usereverse proxy server. Inthis documentationis definiton what exactly isreverse proxy server.A proxy server is a go‑between or intermediary server that forwards requests ... |
docker-compose, export environnement variables are not working in Jenkins | I have a docker-compose.yml file with differents variablesversion: "2"
services:
data:
image: "${registryUrl}/data:${image_version}"In my shell, I export registryUrl & image_versionexport registryUrl=zhcjie.distribution.ata.com:8652
export image_version=1.0-SNAPSHOT
docker-compose upthat's work in my local (I'... | Your environment variables inside jenkins shell will not be imported automatically. Add environment variables through.envfile under your Jenkins job's workspace.$ cat .env
registryUrl=zhcjie.distribution.ata.com:8652
image_version=1.0-SNAPSHOTThen rundocker-compose up |
VS Code devcontainer - what is the difference between containerUser and USER in Dockerfile? | From thedoccontainerUser: Overrides the user for all operations run as inside the
container. Defaults to either root or the last USER instruction in the
related Dockerfile used to create the image.Does it mean that when you set upcontainerUserbelow indevcontainer.json"containerUser": "user-name"Just same asUSERinDocker... | From thedefinition of devcontainer.json schema{
"containerUser": {
"type": "string",
"description": "The user the container will be started with. The default is the user on the Docker image."
},
}So,containerUseris the same as theUser on the Docker Image. |
PhpStorm mapping paths | I'm setup a docker container with SSH and FTP access.My local project looks like this:/Users/gezimhome/projects/ziprecipes.net/zip-recipesis my project dir. The source code for my WordPress plugin is insrcfolder.
I have wordpress downloaded and extracted locally here in/Users/gezimhome/projects/ziprecipes.net/workdir/w... | When setting up aServertheHostneeds to match server host name. For my case I set server host tozrdn:The web server needs to have the server name configured as well. In my case, I configurednginxlike so:server {
listen 8080;
server_name zrdn;
...Thanks a million, @LazyOne! |
Mysql container not starting up on Kubernetes | I was usingthisimage to run my application indocker-compose. However, when I run the same on a Kubernetes cluster I get the error[ERROR] Could not open file '/opt/bitnami/mysql/logs/mysqld.log' for error logging: Permission deniedHere's my deployment fileapiVersion: apps/v1
kind: Deployment
metadata:
annotations:
... | Try changing the file permission usinginit containeras in official bitnami helm chart they are also updating file permissions and managing security context.helm chart :https://github.com/bitnami/charts/blob/master/bitnami/mysql/templates/master-statefulset.yamlUPDATE:initContainers:
- command:
- /bin/bash... |
Nginx retry same end point on http_502 in Docker service Discovery | We usedocker swarmwithservice discoveryfor BackendRESTapplication. The services in swarm are configured withendpoint_mode: vipand are running inglobalmode. Nginx is proxy passed with service discovery aliases. When we update Backend services sometimes nginx throws 502 as service discovery may point to the updating serv... | I suggest you add a health check directly at container level (here)By doing so, docker pings periodically an endpoint you specified, if it's found unhealthy it will 1) stop routing traffic to it 2) kill the container and restart a new one. Therefore you upstream will be resolved to one of the healthy containers. No nee... |
Run npm update in docker without using the cache on that specific update | Background:I'm writing code innode.js, usingnpmanddocker. I'm trying to get my docker file to use cache when I build it so it doesn't take too long.We have a "common" repo that we use to keep logic that is used in a variety of repositories and this gets propagated is npm packages.The problem:I want the docker file NOT ... | So I finally managed to solve this usingthis answer:What we want to do is invalidate the cache for a specific block in the Docker file and then run our update command. This is done by adding a build argument to the command (CLI or Makefile) like so:docker-compose -f docker-compose-dev.yml build --build-arg CACHEBUST=0A... |
volume mount tensorflow container for persistance storage | Hi I am trying to getTensorFlownotebook folder mounted to/src/workfolder in Ubuntu.sudo docker run -it -v /src/work:/HOME/notebooks -p 8888:8888 tensorflow/tensorflow:1.3.0I have tried many combination of -v flags. It is not reading the files already in my work folder or saving new files to it. | You're mounting the volume incorrectly, precisely the path. It should be-v ~/[absolute path from $HOME]/src/work:~/notebooks/Explanation:Since your working directory is/notebooks, which places it at/$HOME/notebooks. You use~to get to the$HOME. |
Docker maven fabric8 plugin (on Windows): building image gives incompatibility issues ? | Via Maven I would like to build a Docker image from a Springboot project.
I run: mvn clean package docker:build
Issue:ERROR] Failed to execute goal io.fabric8:docker-maven-plugin:0.21.0:build (default-cli) on project spring-boot-docker: Execution default-cli of goal io.fabric8:docker-maven-plugin:0.21.0:build failed:... | This is the solution on Windows 7, 8 and 10 Home:Find the docker machine environment variables. Go to the docker (shell) and type: docker-machine env. The docker host and certification path are important.Add the following properties to your pom.xml (maven) file:(e.g.) tcp://192.168.99.100:2376(e.g.) a pathIn your build... |
Azure DevOps hosted-agent failed to pull windows:2004 | When usingWindows-2019hosted agent(Agent installed with 1809 windows version -Microsoft Windows Server 2019 Datacenter) as Agent Specification, We can't pullmcr.microsoft.com/windows:2004docker image.Exception:I'm familiar withthis solution(Which works perfectly locally).
But, since Docker Desktop doesn't install on th... | So my question is: There is a way to pull mcr.microsoft.com/windows:2004 docker image from the hosted agent?I am afraid there is no such way to pullmcr.microsoft.com/windows:2004docker image from the hosted agent.That becauseMatching container host version with container image versions:Windows Server containers and the... |
I can't run rails console with Docker and Passenger/nginx image | I've the next docker-compose container:# docker-compose.yml
version: '2'
services:
web:
build: .
ports:
- "80:80"
volumes:
- .:/home/app/NAME_OF_MY_APP
db:
image: postgres:9.4
ports:
- "5432"
environment:
POSTGRES_USER: 'postgres'I cannot figure out how can I run the rails console. I'm usi... | First you have to start your composed containers withdocker-compose up, which starts all of your defined services. Then you can attach to your running containers by their name. You get the names of running containers from the output ofdocker ps, e.g.:CONTAINER ID IMAGE COMMAND CREATED STATUS ... |
Dockerize an asnet core webapi | I'm trying to dockerize a aspnetcore webapi. I followed the tutorial here:https://docs.docker.com/engine/examples/dotnetcore/But when I run my container I have this message:Did you mean to run dotnet SDK commands? Please install dotnet SDK from:
http://go.microsoft.com/fwlink/?LinkID=798306&clcid=0x409I download the ... | Try dropping aRUN ln -s fnizz.webapi.dll entrypoint.dlland changing your ENTRYPOINT toENTRYPOINT [ "dotnet", "entrypoint.dll" ]. I believedotnetmight be finnicky on DLL extensions. This pattern also lets you genericize the assembly name -- sometimes useful. |
Injest logs as JSON in Container Optimized OS | I am able to injest logs to Google Log Viewer with the help of stackdriver logging agent from Container Optimized OS as JSON.It injests logs as a value to message, but not as json payload with the default configurationWhat I have tried?I have changed the fluentd config in /etc/stackdriver/logging.config.d/fluentd-lakit... | As@Kamelia Ymentioned about thehttps://issuetracker.google.com/issues/137517429There is a mention on workaround used
@type parser
format json
key_name message
reserve_data false
emit_invalid_record_to_error false
The above snippet parses the logs into JSON and injest to Cloud Logging.In this discussion inGoogle Groupso... |
InfluxDB on Docker-Compose can't read SSL cert file | I'm having some troubles trying to configure SSL with InfluxDB v1.8 running on Docker Compose.I followed theofficial documentationto enable HTTPS with self-signed certificate, but the container crashes with the following error:run: open server: open service: open "/etc/ssl/influxdb-selfsigned.crt": no such file or dire... | The environment variables passed in thedocker-compose.ymlare strings. You don't need to pass the quotes.The influx DB is looking for the certificate under"/etc/ssl/influxdb-selfsigned.crt"...literallySimply remove the quotes and the DB will start:...
- INFLUXDB_HTTP_HTTPS_ENABLED=true
- INFLUXDB_HTTP_HTTPS_... |
Error after moving Docker's dir to NTFS: overlayfs: upper fs does not support <xxx> | I've tried to move my Docker's directory from/var/lib/dockerto an external hard drive, which is formatted with NTFS. I've followedthis guide. However, when I dosystemctl start dockerI get an error, and in the journal I find these:Jun 15 11:38:32 lampo.sial kernel: overlayfs: upper fs does not support tmpfile.
Jun 15 11... | It seems your are using a not supported filesystem for the OverlayFS storage driver. Please, have a look of thesupport filesystem for each storage driverSo, first, retrieve your the filesystem you're using withdf -h.Then, you have 2 options:change the Docker storage-driver from the file/etc/docker/daemon.jsonand use a ... |
Problem adding Memcached support in Docker for PHP8.1 using bookworm | I have aDockerfilerelying onPHP:8.1-apache, running since months.OncePHP:8.1-apachestarted to use Debian bookworm, the memcached client started to give an error while building the image.TheDockerfilerows involved areFROM php:8.1-apache
...
RUN apt-get update --fix-missing -q \
&& apt-get install -y curl mcrypt gn... | Ensure these libraries are installed (in particular,libssl-dev):RUN apt install -y libmemcached-dev zlib1g-dev libssl-devCredit to AKorezin:https://github.com/php-memcached-dev/php-memcached/issues/541#issuecomment-1624041385Then you can follow the usual PECL install process:RUN yes '' | pecl install -f memcached-3.2.0... |
Reattaching orphaned docker volumes | I'm using a docker volume, specified in my dockerfile so that my data can persist on the host. The dockerfile looks something like this:FROM base-image
VOLUME /path/to/something
RUN do_stuff
....When I run the container it creates a volume (call itVolumeA) which I can see when I do adocker volume ls.If I stop and remo... | I prefer using named volumes, as you can mount them easily to a new container.But for unnamed volume, I:run my container (the VOLUME directive causes it to create a new volume to a new path that you can get by inspecting it)move the path of the old volume to that new path.Beforedocker volume commands,I used to do thatw... |
fabric8 docker-maven-plugin: include additional tags on build | I have the fabric8 docker-maven-plugin configured in my pom.xml as follows:
...
...
io.fabric8
docker-maven-plugin
${docker.plugin.version}
package
build
${docker.image.prefix}/${project.artifactId}:%l
Dockerfile
artifact
...
...
I'm using the%lplaceholder which ta... | You can use thetag:https://dmp.fabric8.io/#build-configuration
...
${project.version}
...
...
repo/something/%a:%l
...
${docker.image-tag}
...
...
this will tag your image with both the%lbehavior and the custom set${docker.image-tag}.mvn docker:build -Ddocker.image-tag=mytag |
Cant access environment variables in php | Im having issues accessing OS environment variables in php
I have apache/php installed on a centos 6.3 imagein httpd.conf mod mod_env.so is loaded
in php.ini I have set variables_order = "EGPCS"
restarted httpd (many times)in shell if I type "env" I getDB_PORT_28017_TCP_PROTO=tcp
HOSTNAME=c6188a8bd77f
DB_NAME=/rockmo... | I ended up having a few optionsif docker container needs to run multiple services, setting env vars to /etc/environment will make them available for all users. I added the following line to my Dockerfile CMDCMD ["env | grep _ >> /etc/environment"]if docker container runs a single service, its best to set the entry poin... |
Unable to locate package in docker image | I am trying to setup a docker image for an app using laravel and postgres but I'm running into difficulties trying to install the php driver for postgres.My Dockerfile:FROM php:7.4-fpm
# Arguments defined in docker-compose.yml
ARG user
ARG uid
# Install system dependencies
RUN apt-get update && apt-get install -y \
... | It looks likepgsqlis not included in the PHP Docker image.I useddocker-php-extension-installerto add the extensions I need to my Docker image.I added the following two lines into my dockerfile and everything is working as expected nowADD https://raw.githubusercontent.com/mlocati/docker-php-extension-installer/master/in... |
Connection refused: when uwsgi and nginx in different containers | I am trying to setup two docker containers(yes separate without docker-compose): one with nginx and one with uwsgi with basic flask app.I run containers in same network within dockerMy nginx config for site added/linked to sites-enabled(everything else is default):server {
listen 80;
server_name 127.0.0.1;
... | EDITYou can simply use the hostname of the docker container in theuwsgi_passdirective as both docker containers are on the same subnet.location / {
include uwsgi_params;
uwsgi_pass flaskapp:8080;
}0.0.0.0isn't the IP address of the server, it essentially tells the server to be hosted on every IP tha... |
can not run docker latest on gitlab-ci runner | I'm testing gitlab-ci and trying to generate an image on the registry from the Dockerfile.I have the same code just to test:#gitlab-ci
image: docker:latest
tages:
- build
- deploy
build_application:
stage: build
script:
- docker login -u gitlab-ci-token -p $CI_JOB_TOKEN $CI_REGISTRY
- docker build -t... | Bydefaultit is not possible to run docker-in-docker (DIND) (as a security measure).This sectionin the Gitlab docs is your solution. You must use Docker-in-Docker.After configuring your runner to use DIND your.gitlab-ci.ymlwill look like this:#gitlab-ci
image: docker:latest
variables:
DOCKER_DRIVER: overlay2
servic... |
Does AWS ECS support per container dynamic scalability? | Amazon'sEC2 Container Serviceallows you to run any amount of containers you want, it will choose an EC2 instance(s) to run the containers on automatically. Which are great features. However, we are really concerned aboutautomatic scalability.Scenario:I launch a container via AWS ECS Console.The HTTP requests are starti... | No, you don't get fully automated scaling with basic ECS. What you can do is create an alarm for when load gets high and have the alarm trigger an update to increase the cluster size.Update Nov 29, 2017AWS Fargate is a technology for Amazon ECS and EKS* that allows you to
run containers without having to manage serve... |
Unable to connect to Redis from Docker | Something simillar (Unable to connect to MYSQL from Docker Instanceandredis connect timeout to remote server in a dockerandCalling redis-cli in docker-compose setup) I tried to run for the Redis on Docker.I start theDocker servicelike this:docker run --name some-redis -d redisOutput:docker run --name some-redis -d redi... | You named your containersome-redisand are trying to connect with the nameredis.Trydocker exec -it some-redis redis-cli |
Docker security concerns using unofficial images | How to ensure, that docker container will be secure, especially when using third party containers or base images?Is it correct, when using base image, it may initiate any services or mount arbitrary partitions of host filesystem under the hood, and potentially send sensitive data to attacker?So if I use third party con... | Consider Docker images similar to android/iOS mobile apps. You are never quite sure if they are safe to run, but the probability of it being safe is higher when it's from an official source such as Google play or App Store.
More concretely Docker images coming from Docker hub go through security scans details of which... |
Invalid top-level property "external_links" | I have the following docker-compose file content:version: '3.4'
services:
local-app:
build: ./app/
command: node app
ports:
- '7001:7001'
links:
- search-svc
networks:
docker_app-network:
external: true
external_links:
-search-svcBasically what I 'm trying to do is to link the ' ... | Yaml files are space sensitive. You tried to defineexternal_linksat the top level of the file rather than as part of a service. This should by syntactically correct:version: '3.4'
services:
local-app:
build: ./app/
command: node app
ports:
- '7001:7001'
links:
- search-svc
external_li... |
Communication between linked docker containers | I have two docker containers in the following setup on a host machine:Container 1- UDP Port 5043 is mapped to host port 5043 (0.0.0.0:5043:5043)Container 2- Needs to send data to Container 1 on port 5043 as UDP.Scenario 1I start Container 1 and obtain it's IP address.I use this IP address and configure Container 2 with... | As mentioned inDocker links:Docker also defines a set of environment variables for each port exposed by the source container.Each variable has a unique prefix in the form:_PORT__The components in this prefix are:the alias specified in the --link parameter (for example, webdb)thenumber exposedawhich is either TCP or UD... |
Dronekit-python running in docker connecting to MAVProxy on host | I am using dronekit-python in a docker container and am attempting to connect to an instance of MAVProxy running on my host machine (Mac OSX) using the following command:vehicle = connect('udp:host.docker.internal:14551', wait_ready=True)but am getting the following error:File "/usr/local/lib/python3.7/site-packages/py... | I ended up getting MAVProxy on host and dronekit-python in the docker flask container properly connected.Seemus790's answer in thisgitter threaddid the trick.Working solution:
MAVProxy on host machine (Mac OS in my case)mavproxy.py --master=127.0.0.1:14550 --out udp:127.0.0.1:14551 --out udp:10.55.222.120:14550 --out=t... |
Copying data from and to Docker containers | I have 2 docker containers running on my system.I wanted to copy the data from one container to another container from my host system itself.i know that to copy data from container to host we have to usedocker cp :path in containerNow i am trying to copy the data directly from one container to another, is there any wa... | You should usevolumefor that.First, create a volume:docker volume create --name sharedThen, run containers like this:docker run -v shared:/shared-folder
docker run -v shared:/shared-folder This way,/shared-folderwill be synced between these two containers.Read more about ithereHope it helps |
How can I get a docker container to expose a port while blocking the internet at large? | I want to run a docker container that has no access to the outside internet. I've been using--network=nonefor this successfully. But now I want to host a web server from that container, and access it from outside. When I try, I find that the port mapping is totally ignored:$ docker run --rm -it -p 8000:8000 --networ... | You can try using a custom network with--internaloption and then attaching your container to this network:$ docker network create --internal internal-network
$ docker run --rm -it -p 8000:8000 --network=internal-network python bash |
Error parsing reference: is not a valid repository/tag: invalid reference format | Im trying to make a jenkins pipline that clones code from git and build a docker image then push it to nexus registry
so thats what in my jenkins file :pipeline{
agent any
environment{
DOCKERHUB_CREDENTIALS=credentials('docker_hub')
NEXUS_CREDENTIALS = credentials('nexus')
}
s... | I Had to removehttps://from the url now it works fine |
Django deployment with docker - create superuser | I have 3 environments set up and cannot createsuperuser. The way I migrate and runserver now follows the container so I have an entrypoint.sh:#!/bin/sh
1
2 echo "${RTE} Runtime Environment - Running entrypoint."
3
4 if [ "$RTE" = "dev" ]; then
5
6 python manage.py makemigrations --merge
7 python m... | According tocreatesuperuser -hand thisdoc,createsuperusercommand does not support--passwordflag. to read arguments from environment variables, you should use this command with--noinputflag and set required fields like username, email and password asDJANGO_SUPERUSER_in your env file.python manage.py createsuperuser --no... |
Connecting to MySQL Server on localhost through Docker | So, I'm able to generally contact my localhost through Docker by running a container with--add-host=localbox:192.168.59.3.ping localboxworks just fine. Problem is, I can't seem to be able to even get a response from MySQL Server.mysql -h localbox, which works fine from outside of the docker container, just gets meERROR... | So, turns out this is homebrew's fault with a really questionable design decision. You start-up mysql-server in homebrew by running the recommendedlaunchctl load -w ~/Library/LaunchAgents/homebrew.mxcl.mysql.plist. But then, when examining this file, you'll find the bind-address is hardcoded!
/usr/local/opt/mysql/bin/m... |
libicui18n.so.52: cannot open shared object file | I have been using libicu to detect charset in my node app that runs inside of docker, ubuntu. this is done through the modulenode-icu-charset-detectorthat uses thelibicu-devpackage, which I install prior to the npm package.It all worked fine but I suddently get the errormodule.js:356
Module._extensions[extension](thi... | As @mscdex has pointed out, libicu was looking for the libicu52 package. Somehow the repository got updated allowing me to pull the new libicu which depends on libicu52 that isn't available in the repository of 12.04, but in 14.04. Since there is no official trusted build of 14.04 in the docker registry, I made my own ... |
What is the docker daemon version on Vagrant provisioner? | I am trying to understand which is the version that Vagrant installs on its VM (my specific case: using box ubuntu/trusty64) if a Docker provisioner is selected.
In particular, I would like it to be a fixed version since it has to reflect my staging environment.Unfortunately, in thedocumentation of the provisionernoth... | Basically vagrant will try to install the latest version available from the repo. You can review in thesource codemachine.communicate.tap do |comm|
comm.sudo("apt-get update -qq -y")
comm.sudo("apt-get install -qq -y --force-yes curl apt-transport-https")
comm.sudo("apt-get purge -qq -y lx... |
Connecting a flask container to a redis container over kubernetes | I've just setup a redis instance however I can't seem to get the two containers to talk to each-other, the setupworks over local machine with docker-compose but does not seem to be working with kubernetes.My logs tell me flask can't find the service, so the error must be my configuration filesFlask code:rDB = redis.Red... | Here is a service I created my redis cluster inside k8s.apiVersion: v1
kind: Service
metadata:
labels:
app: redis
name: my-redis-svc
namespace: default
spec:
ports:
- name: redis
port: 6379
targetPort: 6379
protocol: TCP
selector:
app: redis
type: ClusterIPIf you create that service. Y... |
Spring boot JDBC can't connect to mysql in docker container | I'm trying to run a spring boot app (as a simple REST api) and mysql server in two separate docker containers. But, I can't get the jdbc connection in the spring app to connect to mysql. They are both working independently and the implementation works when I run spring boot and mysql locally.docker-compose.ymlversion: ... | change thisdataSource.setUrl("jdbc:mysql://mysqldb:3306/$dbName"), to:dataSource.setUrl("jdbc:mysql://database:3306/$dbName")your service name incomposeisdatabase, so you need to use it |
Docker doesn't recognize the -p command all of a sudden | So I just updated Docker on my Mac and getting adjusted to Docker seems to be quite challenging and confusing.A few weeks ago, I was able to mind port 8834 on the docker container to port 8834 on my local host by running the following commands (this is my command line history):8450 docker attach -p 8834:8834 compassio... | Publishing ports can be done only with newly created containers not existing containers. So you need to stop the container and create a new one with the port you need |
Laravel Sail/Docker - Unable to locate package msodbcsql17 | I'm trying to get a Laravel Sail Docker to be compatible with sqlsrv (MSSQL). I've come a long way with the config and got it to install sqlsrv and the pdo_sqlsrv. So now I need to install msodbcsql17. For that I'm following the microsoft guide (https://learn.microsoft.com/nl-nl/sql/connect/odbc/linux-mac/installing-th... | By default most docker images have an empty package lists to save on image size. This is why you need toapt-get updatefirst. This will not update any software (that would beapt-get upgrade) but just updates the package list. The command is actually also in Microsoft's instructions you linked. |
How to push a docker image to Azure container registry using terraform? | I am a beginner in Terraform/Azure and I want to deploy a docker image in ACR using terraform but was unable to find internet solutions. So, if anybody knows how to deploy a docker image to an azure container registry using Terraform, please share.
Tell me whether this is possible or not. | You may use Terraform resourcenull_resourceand execute your own logic in Terraform.Example:resource "azurerm_resource_group" "rg" {
name = "example-resources"
location = "West Europe"
}
resource "azurerm_container_registry" "acr" {
name = "containerRegistry1"
resource_group_name = ... |
How to get `docker run` full arguments? | For example, I run a docker bydocker run -d --name sonarqube -p 19000:9000 -p 19002:9002 -e SONARQUBE_JDBC_USERNAME=sonar -e SONARQUBE_JDBC_PASSWORD=123 --link sonarqube-mysql:mysql.Then I lost my shell command history, but I want to know all my arguments.
How can I get them? (I need the arguments to copy/move/restart ... | Of coursedocker inspectis the way to go, but if you just want to "reconstruct" the docker run command, you havehttps://github.com/nexdrew/rekcodit saysReverse engineer a docker run command from an existing container (via docker inspect). |
How to use curl -4 http://localhost in the Docker part 3 tutorial? | Using the Docker tutorial I'm stuck at this part:https://docs.docker.com/get-started/part3/#run-your-new-load-balanced-appI usecurl -4 http://localhostbut i get acurl: (7) Failed to connect to localhost port 80: Connection refusederror.output of previous step:docker service ps getstartedlab_webID NAME ... | For part 4 when you deploy to your swarm, you get an URL withdocker-machine ls.NAME ACTIVE DRIVER STATE URL SWARM DOCKER ERRORS
myvm1 * virtualbox Running tcp://192.168.99.100:2376 v17.10.0-ce
myvm2 - virtualbox Running tcp://192.168... |
Mount volume from host in Dockerfile long format | When configuring adocker-compose.yml, I can easily mount a volume that maps a folder from the host machine to the container:...
volumes:
- "/host/folder/:/container/folder/"
...However, if I try to use thelong syntax, that doesn't work anymore:...
volumes:
- type: volume
source: /host/folder
... | Thetype:field says whether it's a namedvolume, abindmount, or a couple of other things. Since you're mounting a host directory, you need to specifytype: bindin the extended syntax.volumes:
- type: bind # <-- not "volume"
source: /host/folder
target: /container/folder/according to the docs, "volumes a... |
deploy docker container on AWS EC2 instance without being logged in | I'm a beginner with microservices and have spent hours on the most tiny painful things of AWS today, would appreciate any expert advice as I suspect the next step is very small but could take me hours to work it out otherwise.So I deployed a nano instance thensshinto it. Had to actually redo it to fix the security grou... | I see a few things wrong:You should use a Docker registry service instead of SCPing an image. On AWS there is EC2 Container Registry or you can also use Docker Hub as well. This will make it much easier to get your images onto your instances.I'm not sure why you weren't able to start your container using the console. I... |
Installing custom modules into docker container | I have several services running in their own Docker containers. In my project I also have alibfolder containing some small modules that all the services need.What is the best way to include these modules into the Docker containers? Obviously third party modules I just useRUN pip install -r requirements.txt, is there a ... | I ended up managing it out by mounting thelibfolder into the container usingdocker-compose, like so:version: '2'
services:
frontend_web:
build: .
volumes:
- ../../lib:/app/libI then just had to add /app/lib to the container'sPYTHONPATHand I could import any module from that folder. |
DigitalOcean: How to run Docker command on newly created Droplet via Java API | I'm trying to create a new Droplet and then kick off a Docker command via a UserData bash script. I set the user data via the Java API when creating the droplet and observe that the test files and logs I made are created.newDroplet.setUserData("#!/bin/bash\n" +
"touch /test.txt;"+
"docker login... | The problem ended up being the -t flag in the docker run command. Apparently this doesn't work because it isn't a terminal or something like that. Remove the flag and it runs fine. |
Unable to share/mount Volume with Docker Toolbox on Windows 10 | I am trying to setup my project with docker. I am using Docker Toolbox on Windows 10 Home. I am very new to docker. To my understanding I have to copy my files to new container and add a volume so that I can persist changes made by gulp.Here is my folder structure-- src
|- dist
|- node-modules
|- gulpfile.js
|- package... | @sxm1972 Thank you for your effort and help.You are probably using Windows Pro or a server edition. I am usingWindows 10 Home editionHere is how I solved it, so other people using same setup can solve their issue.There may be a better way to solve this, please comment if there is an efficient way.So...First, the questi... |
How to send bamboo variables from Bamboo script to docker container? | I'm using Docker plugin for bamboo and I need to execute a script in the docker container.The sh script contains:echo \"ini_source_path\": \"${bamboo.ini_source_path}\",and if I put this line directly in Container Command, the ${bamboo.ini_source_path} will be replaced with value of this variable.The problem in when I ... | What version of Bamboo are you using? This problem was fixed in Bamboo 6.1.0:Unable to use variables in Container name field in Run docker taskWorkaround:Create a Script Task that runs before the Docker Task.Run commands likeecho "export sourcepath=$ini_source_path" > scriptname.sh
chmod +x scriptname.shThe Docker Task... |
Why the docker container memory usage doesn't decrease? | I'm running a Java REST app withApache JavaSparkin this container, but I noticed that each request is adding the memory usage and not decreasing after the request is done. My first guess was that I had forgotten to close some stream/buffer (this app deal with a lot of file manipulation), but I reviewed all the code and... | Java usually allocates memory that has previously reserved, it only frees it when you restart the process. You can see this post that gives the full explanation.java.exe process uses more memory and does not free it up |
Unable to have Docker containers communicate with each other | I have two Docker containers, one running a React app (built using create-react-app) and another with a Node app API. I have a docker-compose file set up, and according to thedocumentationI should be able to use the names of the services to communicate between containers.However, when I try to send a request to the/log... | As discussed in the comments on the original post this was a DNS issue. Configuring the DNS was a little to involved for the use case of this project, so I've solved my problem by using an environment variable to set the URL that is used to make calls to my API container based on whether I'm running on a dev or prod en... |
How containerd copy a file from host to a running container? | I find that I can usectr snapshot mountto copy a file from a container to a host.
But how can I copy a file from a host to the container using containerd?
I used golang to write some code to start a container, but I can't find any documentation about copying host files to a running container. | As of now there is no provision as such with either withctrorcrictlcli to copy a host file to a running container as we have withdockercli (eg: docker cp).Though there is a project under containerd known asnerdctlwhich is trying to emulate the same.nerdctlis a Docker-compatible CLI for containerd.Link for reference:ner... |
Change UID and GID in alpine docker container | I want to change an alpine-based container user's UID and GID.But there's nousermodandgroupmod. Are there equivalents?(This is for a running container, not an image.) | Thedocker runcommand can be passed a user and group (or uid / gid).docker run --user 2000:2000 acmeOr, via compose, theuser:attribute can be used.compose.ymlservices:
acme:
image: my-alpine:latest
user: 2000:2000In the case that ids are used, neither the user id or group id needs to exist in the container. |
Docker-compose with .NET Core unreachable | Im new to Docker and im trying to set up 2 containers, one running mongoDB and one running the web application.The problem is that I can not access my .NET core application via localhost:5000 or 0.0.0.0:5000.Mongo is running fine.Here is my docker-compose.ymlversion: '3'
services:
web:
build: .
ports:
- ... | Looks like .NET uses port 80 in production, so when Ive changed docker file and exported port 80 instead of 5000 and also changed port 5000 to port 80 in docker-compose it works as supposed.So I assume in order to run it on port 5000 it will need some configuration on .NET side. |
How can i get client real ip address in PHP? | I'm trying to get my ip address.Here is the code, thegetClientIp()method uses a$_SERVER['REMOTE_ADDR']global variable internally, so$request->getClientIp()and$_SERVER['REMOTE_ADDR']are the same.getClientIp())->json();I have php deployed in docker on my local machine. So I send a request to localhosthttp://localhost/api... | Your PHP app has no clue about your public IP as it is in the private network. Public IP is assigned to you by your ISP/Router. Router NATs the private IPs so only 1 IP is allocated to your private network."What is my IP" website is in the public internet, so it sees your public IP and it has no clue about your 172.xxx... |
Why is docker pull not extracting layers in parallel? | Does extracting (untarring) of docker image layers bydocker pullhave to be conducted sequentially or could it be parallelized?Exampledocker pull mirekphd/ml-cpu-r40-base- an image which had to be split into more than 50 layers for build performance reasons - it contains around 4k R packages precompiled as DEB's (the en... | From the discussion athttps://github.com/moby/moby/issues/21814, there are two main reasons that layers are not extracted in parallel:It would not work on all storage drivers.It would potentially use lots of CPu.See the related comments below:Note that not all storage drivers would be able to support parallel extractio... |
How to run docker image as singleton | I'm new to docker.I have an image that I want to run, but I want docker to see if that image is already running from another terminal...if it is running I don't want it to load another one...is this something that can be done with docker?if it helps, I'm running the docker with a privileged mode.I've tried to search fo... | You can use the following docker command to get all containers that running from specific image:docker ps --filter ancestor="imagename:tag"Example:docker ps --filter ancestor="drone/drone:0.5"Example Output:CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS ... |
How to define/use endpoints to connect to Kubernetes from Javascript | I have a doubt regarding how to structure my dockerized stack, simplified in two containers to get help here:static: NGINX serving static resources (JS/HTML).rest: express.js backend for the REST Api.Without Kubernetes, just docker-compose on a node,restis simply listening on a different port and, from Javascript, the ... | With Kubernetes, I understand that I need to use the service name from
Kubernetes, something like "rest" (to make transparent the service
itself), but that name would only be visible from the docker container
serving the static resources.Your understanding is correct.As long as you have a kube-dns add-on running ... |
Why are the `keepalives` params in `psycopg2.connect(...)` required to run long running postgres queries in docker (ubuntu:18.04)? | We just transitioned to using Docker for development and are using theubuntu:18.04image. We noticed that queries usingpsycopg2failed after a few minutes.This answersolved the problem using the followingkeepalivesparams:self.db = pg.connect(
dbname=config.db_name,
user=config.db_user,
password=config.db_pass... | You are probably using Dockers Overlay Network feature (or Ingress network for loadbalanced services), which is based on Linux IP Virtual Server (IPVS), a.k.a.Linux Virtual Server. This uses a default 900 second (15 minutes) timeout for idle TCP connections.See:https://github.com/moby/moby/issues/31208Default Linux TCP... |
Is there any way to optimize size of Docker Image? | I have Angular application running locally with V10. I am trying to build an Docker image with help of Dockerfile.But while building images, my Docker image size is building huge as 1.32GB. Is there any way to reduce its size ?Below is the Dockerfile which i wrote# base image
FROM node:12.2.0
# set working directory (... | I resolved this issue, by not copying node_modules folder while creating images. So what i did is i just took clone from github where node_modules folder itself is not available and create the image. After that total size becomes only 14.48 MB. So, removing node_modules resolve my issue. |
Why did mysql data ownership change to systemd-journal-remote after running a docker container | I have the mysql database stored in/home/mysqlinstead of/var/lib/mysql. The directory used to be owned bymysql. However, when I run the commanddocker-compose upwith this yml file:version: '3'
services:
mariadb:
image: mariadb
restart: always
volumes:
- /home/mysql:/var/lib/mysql
elasticsearch:
... | You should start Docker's container with--userparameter. If you do this and set the sameuid:gidas owner of the MySQL storage you will no have problems with permissions. You have to check how exactly to do this in Docker Compose because I show you example for normal command line execution |
GET error : ModuleNotFoundError: No module named 'api' | I've got an error when I try to run pytest command. The error is just when I running the application on docker, when I did it locally, it works. There's another curiosity about it, the swagger and de requests are working fine, just the test file doesn't. I have already tried :python -m pytest tests/pytest tests/test_ap... | Your code is for the most part just fine you just have a path problem and a invalid test class.Also it is not good practice to have your test package into your api package.you should do something like this:.
├── api
│ ├── __init__.py
│ ├── main.py
│ └── routers
│ │ ├── __init__.py
│ │ ├── something.py
│ ... |
Remove private docker registry credentials from Spring Boot POM file | I want to create docker images with CI/CD (Jenkins) of my spring boot application and push the image to a private nexus docker registry.
How to avoid adding my docker credentials to POM file and have them in GIT? Where should I pass/place the credentials instead?Or should I just push the image manually in jenkins withd... | You could use variables in your POM and pass them when calling maven. You should store the credentials in jenkins credentials managere.g.:...
${DOCKER_REGISTRY}/${project.artifactId}:${project.version}
...
org.springframework.boot
spring-boot-maven-plugin
${DOCKER_IMAGE_NAME}
true
${DOCKER_REGISTRY_USER}
${DO... |
No Install group file - CentOS 7 - group install | I am using CentOS image inside a docker container everyyum install works but when i try to runyum groupinstall "Development tools"it just raise error saying:There is no installed groups file. Maybe run: yum groups mark convert
(see man yum)Here is my Dockerfile# Starting from base CentOS image
FROM centos:7
RUN yum ... | Doing the following may work, and is consistent with your error message:yum groups mark install "Development Tools"
yum groups mark convert "Development Tools"
yum groupinstall "Development Tools"Source:https://access.redhat.com/discussions/1262603 |
ENTRYPOINT in Combination with CMD | I have spent some time to grasp the difference betweenENTRYPOINTandCMDin a dockerfile. In this case I am doing some research, so even if the Idea here might not be the best, that is more about getting how that works.If I understood everything right, than:ENTRYPOINT ["/bin/bash", "-l", "-c"]
CMD ["node index.js"]should ... | Do this and be happy:ENTRYPOINT ["/entry.sh"]
CMD node index.jsentry.sh:#!/bin/bash
#entry.sh
#step 1
npm install
#step 2
npm run watch &
#step 3
compass watch &
#step n
exec "$@"Be sure of:chmod +x entry.shAnd in Dockerfile:COPY entry.sh / |
Docker run not working it says requires at least 1 argument | I'm learning docker, and trying to run the existing images. The first command is working finecommand 1: docker run --name static-site -e AUTHOR="Mathi1" -d -P dockersamples/static-siteBut the below command is throwing errorCommand 2: docker run --name mvcdotnet -e AUTHOR="Mathi2" -d -p valkyrion/mvcdotnetError:"docker ... | According todocker help run:…
-p, --publish list Publish a container's port(s) to the host
-P, --publish-all Publish all exposed ports to random ports
…Command 1 uses-P(short form of--publish-all) and after that the image name.-Phas no arguments.
Command 2 uses-p(short form of--publ... |
Docker multiple same port issue | I am currently working on two inter related ASP.NET Core WebAPI services (Service1 & Service2) in a solution. Both are having docker files and exposing port 80.Service1 is an independent service and required to be called from Service2. I have given both docker-compose.yml and docker-compose.override.yml.docker-compose.... | You should stick with the default bridge mode (by removingnetwork_mode: bridge) and change- SERVICE1=http://localhost:1001to- SERVICE1=http://services1:80 # services1 will be resolved by dockerBecause service1 and service2 are on separate containers, so there is no opened port 1001 on the container of service2. |
Developer environment - how to call/consume other micro services | BackgroundMy Environment - Java, Play2, MySqlI've written 3 stateless Restful Microservices on Play2 -> /S1,/S2,/S3S1 consumes data from S2 and S3. So when user hits /S1, that service asynchronously calls /S2, /S3, merges data and returns final json output. Side note - The services will be shipped eventually as dock... | The easiest way (IMO) is to set up your development environment to mirror as closely as possible your production environment. If you want your production application to work with 20 microservices, each running in a separate container, then do that with your development machine. That way, when you deploy to production, ... |
Docker: "unrecognised option '-p'" | Running a docker container ...docker run --name mongodb -d mongo:3.4-xenial --expose 27017Results in the error "Error parsing command line: unrecognised option '-p'" in the log.However, moving the--exposeparameter to the left works fine:docker run --name mongodb --expose 27017 -d mongo:3.4-xenialI don't understand why,... | Thedocker runsyntaxis:docker run [OPTIONS] IMAGE[:TAG|@DIGEST] [COMMAND] [ARG...], everything you're passing after theIMAGE[:TAG|@DIGEST]is being passed as[COMMAND] [ARG...]to theENTRYPOINTof the container.Adocker inspect mongo:3.4-xenial --format {{.Config.Entrypoint}}shows theENTRYPOINTasdocker-entrypoint.sh(e.g. you... |
Docker container IP address from .net project | This seemingly simple task turns out very difficult.I am trying to get docker container's IP from .net project, in my case using c#.What I have tried so far (This returns docker engine's IP (DockerNAT), not the container's IP):Dns.GetHostEntry(name).AddressList.FirstOrDefault(x => x.AddressFamily == System.Net.Sockets.... | A different answer than most sharing it anyway for those who need that IP.I agree with @david-maze that you can get away in most cases without ever knowing the IP address. And withdocker-composecreating theyamlfile will have a friendly name to all the services.With that said in events when you just need the IP address,... |
Concourse add file to docker image just once | I am using concourse for our build system.Concourse caches docker images so that we don't need to go through the download process each on subsequent runs.I want to add a binary file to the docker image which I will pull from the internet, but I only want to do it the first time the docker image is pulled and created by... | You should check out thedocker-image-resource. You can define a Dockerfile with all of the dependencies that you want, and then push that as a resource that can be used in later builds. We wrote atutorialon this that might clear things up a bit. |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.