Prompt stringlengths 14 160 | Instruction stringlengths 18 2k | Response stringlengths 8 2k |
|---|---|---|
Running Django migrations on dockerized project | I have aDjangoproject running in multipleDockercontainers with help ofdocker-compose. The source code is attached from directory on my local machine. Here's the compose configuration file:version: '3'
services:
db:
image: 'postgres'
ports:
- '5432:5432'
core:
build:
context: .
dockerfi... | Your docker-compose configurations are not correct. You forgot to link servicesversion: '3'
services:
db:
image: 'postgres'
ports:
- '5432:5432'
core:
build:
context: .
dockerfile: Dockerfile
command: python3 manage.py runserver 0.0.0.0:8000
ports:
- '8001:8000'
volum... |
docker-py reading container logs as a generator hangs | I am usingdocker-pyto read container logs as a stream. by setting thestreamflag toTrueas indicated in the docs. Basically, I am iterating through all my containers and reading their container logs in as a generator and writing it out to a file like the following:for service in service_names:
dkg = self.container.lo... | The problem is that the stream doesn't really stop until the container is stopped, it is just paused waiting for the next data to arrive. To illustrate this, when it hangs on the first container, if you dodocker stopon that container, you'll get aStopIterationexception and your for loop will move on to the next contain... |
A Solution to Kubernetes pods stuck on Terminating | I was one that was having trouble with this above mentioned issue where after a "kubectl delete -f" my container would be stuck on "Terminating".
I could not see anything in the Docker logs to help me narrow it down.
After a Docker restart the pod would be gone and i could continue as usual, but this is not the way to ... | Askleufmentioned in comments, the solution to the stuck docker container in his case was the following:When i installed Kubernetes on Ubuntu 16.04 i followed a guide that
said to install "docker.io". In this article it said to remove
"docker.io" and rather use a "docker-ce or docker-ee" installation.sudo apt-get re... |
How to build the rpm package with SHA-256 checksum for files? | In standard alone RHEL 6.4 rpm build environment, the rpm packages is generated with SHA-256 check sum, which is gotten by commandrpm -qp --dump xxx.rpm[user@redhat64 abc]$ rpm -qp --dump package/rpm/abc-1.0.1-1.x86_64.rpm
..
/opt/company/abc/abc/1.0.1-1/bin/start.sh 507 1398338016 d8820685b6446ee36a85cc1f7387d14537d6f... | It is not related with docker, it can be enabled by follow configurationecho "%_binary_filedigest_algorithm 8" >> $HOME/.rpmmacrosThe reason for it is ok in standard alone RHEL 6.4 is because it has theredhat-rpm-configpackages.bash-4.1# yum install redhat-rpm-configIn the package, this configuration exists in/usr/lib... |
How to upgrade the pg_restore in docker postgres image 10.3 to 10.5 | I use tableplus for my general admin.Currently using the docker postgres image at 10.3 for both production and localhost development.Because tableplus upgraded their postgres 10 drivers to 10.5, I can no longer use pg_restore to restore the backup files which are dumped using 10.5--format=customSee image for how I back... | If I understand you correctly, you want to restore a custom format dump taken with 10.5 into a 10.3 database.That won't be possible if the archive format has changed between 10.3 and 10.5.As a workaround, you could use a “plain format” dump (option--format=plain) which does not have an “archive version”. But any proble... |
Connect python script to mysql in docker | I wanna connect my python script to MySQL in docker.
Here is my docker-compose file:version: '3.7'
services:
mysql:
image: mariadb:${MARIADB_VERSION:-latest}
container_name: mysql
volumes:
- ./mysql:/var/lib/mysql
environment:
- MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD:-password}
... | This usually means that the ports are not open, or a problem with the hostname!you haven't exposed the ports to the outside world, maybe add this lineservices:
mysql:
image: mariadb:${MARIADB_VERSION:-latest}
container_name: mysql
volumes:
- ./mysql:/var/lib/mysql
environment:
- MYSQL_ROO... |
Editing Docker container FS using Atom/Sublime-Text? | I'm running OSX and Docker with the help of boot2docker.From my understanding boot2docker is a lightweight linux distro that is running the docker containers. I have some Ubuntu containers that I use to run and test projects that should specifically run well on Linux.However every small code change from my host text ed... | What I often do is, in development, mount the source code of the application to its usual place in avolume. Then, I set the command (or entrypoint) of the container to a script that launches it in "development mode" (for example, by usingnodemonfor a node.js application, settingRAILS_ENV=developmentin Rails, and so on)... |
can't connect mongodb on host from docker container | I have a mongo on my host machine, and an ubuntu container which is also running on my machine. I want that container to connect to mongo.
I set as host url, my host ip from docker network :172.17.0.1and in the/etc/mongod.conffile I set the bindIp to0.0.0.0from the container, I can ping the host,but the mongo service ... | Do not use0.0.0.0to bind a socket on your host. It can be a security issue. It's the way to declare all IP are able to connect tomongodbfrom any host.Better edit/etc/mongod.confand add thedockerinterface ip, like:# network interfaces
net:
port: 27017
bindIp: 127.0.0.1,172.17.0.1Then, in thedocker run, you can add a... |
docker build is disabled error when installing my chaincode on hyperledger fabric | I am creating a hyperledger fabric network using the following hyperledger fabric operator for kuberneteshttps://github.com/hyperledger-labs/hlf-operatorI have my cluster configured in aws eks and it is currently running 3 nodes. I am following the documentation and so far all the steps of the implementation are workin... | I encountered the same problem and I finally solved it. The problem is when you create your peer node right now (as of July 28, 2022), the version defaults to2.3.0-v0.0.2(you can find thiskubectl hlf peer create --helpand see the description next to the--versionflag). This peer version happens to be incompatible when d... |
How do I get a Command to run from a Dockerfile.aws.json on Elastic Beanstalk? | I have aDockerfileand aDockerfile.aws.json:{
"AWSEBDockerrunVersion": "1",
"Ports": [{
"ContainerPort": "5000",
"HostPort": "5000"
}],
"Volumes": [{
"HostDirectory": "/tmp/download/models",
"ContainerDirectory": "/models"
}],
"Logging": "/var/log/nginx",
"Comm... | If you haveENTRYPOINTin your Dockerfile, than theCommandgets appended as itsarguments:Specify a command to execute in the container. If you specify an Entrypoint, then Command is added as anargument to Entrypoint. For more information, see CMD in the Docker documentation.Thus your Commandmkdir -p /tmp ...will be used a... |
Get the data of Build.Repository.LocalPath and used it in my DockerFile | I want to get the data from the variableBuild.Repository.LocalPathand use it in my Dockerfile, but it shows me and error.This is my dockerfile:FROM microsoft/aspnet:latest
COPY "/${Build.Repository.LocalPath}/NH.Services.WebApi/bin/Release/Publish/" /inetpub/wwwrootI get this error:Step 2/9 : COPY "/${Build.Repository... | You can add in the Dockerfile an argument:ARG pathIn the Azure DevOps Docker task add an argument:-task: Docker@2
inputs:
command: build
arguments: --build-arg path=$(Build.Repository.LocalPath)Now the Dockerfile know the variable value and you can use it, for example:FROM ubuntu:latest
ARG path
ECHO $pathResult... |
corrupt date with redis:6-alpine on RasPi | I'm running redis in a docker container on a RasPi 4 (redis:6-alpine). It is used by Nextcloud in another container (via docker-compose).
Since a few days redis is using 100% CPU time.I now saw that the date/time in the container is corrupt. Redis seems to start normally, but the log saispi@tsht2:/data/nextcloud $ dock... | Raspbian stable is listed athttps://wiki.alpinelinux.org/wiki/Release_Notes_for_Alpine_3.13.0#time64_requirementswith an outdated version of libseccomp (quoting: ... [requiring] host libseccomp to be version 2.4.2 or greater ...). Note that for Raspbian libseccomp is known as libseccomp2. In this case: either update li... |
Environment variables with docker run -e | Here is my Dockerfile :FROM ubuntu:16.04
RUN apt-get update
RUN apt-get install -y default-jdk
ADD sample-docker-1.0-SNAPSHOT.jar app.jar
EXPOSE 8080
ENV SITENAME="ASDASD"
ENTRYPOINT ["java", "-jar", "app.jar"]and here is a bit of Java code that i use:@Value("${SITENAME:testsite}")
private String siteName;with th... | You want to pass the-eto the docker command. So:docker run -P -d --name spring -e "SITENAME=DOCKERlocal" spring-appAs you are doing it, you are passing it to the image entrypoint. |
Run GUI programs in Docker in Ubuntu | I used to run programs with commands like this:docker run -ti \
--name wireshark \
-e DISPLAY=$DISPLAY \
-v /tmp/.X11-unix:/tmp/.X11-unix \
-v $HOME/.Xauthority:/root/.Xauthority \
--privileged \
-d ubuntu:17.10 /bin/bashthen I could run wireshark using my Ubuntu's system's display.
Like this page's example:Running... | It is possible to solve this withxhost +but it would then be wise to doxhost -after you no longer use this container.In fact the more restrictivexhost +local:dockeris enough |
Using a PostgreSQL database with Docker and Flask, how does it work? | I just started using Docker and created an image and running container with Python3, Flask, UWSGI and nginx.Now I want to use a postgresql database in Flask. I read the following page and linking containers seems logical to me. (https://hub.docker.com/_/postgres/)I still have some question or maybe the principle of Doc... | I rebuild the image or restart the container, where does my database data go? Is it gone?No, the data is not gone. The only time data is removed is if you remove the container:docker rm . The only time this isn't true is if you mount a volume to the container to expose the data volume:docker run -td -p 5432:5432 -v /... |
What is the difference between docker host and node? | I know that questions similar to this one is already asked on SO. But, it doesn't make clarification on what I am looking for.I am trying to get my hands dirty on docker. I have encountered the terminologydocker hostanddocker node. I am referring this article:-https://docs.docker.com/get-started/part3/#docker-composeym... | A docker host refers to the server in the client server pair. It's the instance of the dockerd engine, and where containers are run.A docker node refers to a member in a swarm mode cluster. Every swarm node must be a docker host, but not every docker host is necessarily a member of a swarm cluster. |
Does Jenkins support docker-compose | I read in certain docker plugins, such asdocker-slave-plugin, it shows there is support for compose but I do not understand how to implement it.Has anyone used docker-compose in the Jenkins pipeline and how? | The short answer appears to be no. It does not directly support compose.I got around this by using thescript{}blocks in the Jenkinsfile to manually calldocker-compose upwhich worked fine. |
Docker for Windows - access container in local network | I have installed Docker for Windows on which I have running Nexus Repository Manager container. Now I want to make my nexus container be accessible from other pc's located in internal network.How to do it? | You have to map the port to the container.
Example for port 443:docker run -d -p 443:443 $imagename$You also have to make sure that your windows firewall is not blocking that port. Maybe you have to create a new rule.BR
Hannes |
Getting 32 bit Centos docker image | I was trying to run 32 bit Centos in container:sudo docker run -it i386/centos:6Inside container I run commanduname-ain order to know it is 32 bit. Got output:4.10.0-28-generic #32~16.04.2-Ubuntu SMP Thu Jul 20 10:19:48 UTC 2017 x86_64 x86_64 x86_64 GNU/LinuxAccording to my understanding it is 64 bit version and not ex... | Containers share kernel with the host system. Thats why you see ubuntu in the output which is your host system kernel. These containers only have 32bit packages installed and they will work fine with your 64bit kernel. |
Referencing the first argument passed to the docker entrypoint? | I'm trying to obtain the value of the first argument I pass to the Docker Entrypoint. I received an answer earlier on how to do this. Here is the link:Referencing a dynamic argument in the Docker EntrypointSo I setup an experiment to see if this works:Here's my Dockerfile:FROM alpine:3.3
MAINTAINER[email protected]RU... | Change ENTRYPOINT to next:ENTRYPOINT ["bash", "run.sh"]It works for me. Read more about entrypoint args herehttps://docs.docker.com/engine/reference/builder/#entrypoint |
Docker awslogs gives error NoCredentialProviders | ProblemI'm trying to send docker logs to Aws Cloudwatch using myon premise serverbut it keeps failing on authentication. I've spent tons of hours searching through documentation and tutorials - and yet it does not work.ApproachI've installed AWS-cli and configured it, so ~/.aws/config is filled with my credentials. I'v... | I was facing similar kind of issue on ubuntu 18 instance.
Following are the steps which worked for me:mkdir -p /etc/systemd/system/docker.service.d/touch /etc/systemd/system/docker.service.d/aws-credentials.confvi /etc/systemd/system/docker.service.d/aws-credentials.conf
content of file as follows:
[Service]
Environmen... |
Docker container accessible only via Cloudflare CDN (selected ip ranges) | I have webserver in docker container, but I cannot configure iptables on my host (Debian). I want allowonlyspecified ip addressess to connect on ports 80 and 443 to my machine (host). Port 22 should be accesible from any ip. In my case, allowed should be Cloudflare ip addresses. Cloudflare ips are available athttps://w... | SOLUTION:iptables -F DOCKER-USER
iptables -I DOCKER-USER -j RETURN
iptables -I DOCKER-USER -p tcp -m multiport --dports http,https -j DROP
for i in `curl -s https://www.cloudflare.com/ips-v4`;\
do iptables -I DOCKER-USER -p tcp -i eth0 -m multiport --dports http,https -s $i -j RETURN;\
done
iptables -I DOCKER-U... |
How do I set-up file ownership between WSL + VS Code and a Docker container? | My issue is that I don't know (nor understand) how to best configure file ownership between a host and a container. I'm a front-end dev by trade so out of my depth here.Host: Windows 10 running WSL2 (Ubuntu 20.04 LTS). Using the VS Code WSL Remote extension.Container:php:7.4-fpmrunning WordPress.WordPress is running ju... | Solved.Found a solution here that worked for me. This 'locks' the user that owns the files in the container towww-datawhilst preserving the original user,andrewon the host. |
how to permanently set environment variable for boot2docker | I have tried to put my environment variable at /var/lib/boot2docker/profile file at guest machine, and restart itexport http_proxy=http://proxy:portthen i open shell from my host machine (Windows 7) by usingdocker-machine ssh defaultI can't find 'http_proxy' from my environment variable by usingenv | Thedockerdaemon sources/var/lib/boot2docker/profilebefore starting. TheHTTP_PROXYvariable will be available in thedockerdaemons environment. Users logging in viasshwillnotsee this variable.Any/etc/profile.d/*.shfiles will be loaded into a users profile at login but as you pointed out, this is reset back to the base ima... |
How to get Adminer to run locally using Docker | I am having issues with running Adminer on my localhost.
After running this command:$ docker run --rm -ti --network host adminer
[Sun Jan 10 18:19:33 2021] PHP 7.4.14 Development Server (http://[::]:8080) startedI expect to see Adminer running on localhost:8080, however my browser "can't establish a connection to the s... | If you have to run docker on a virtual machine then I think it's only listening to port 8080 on that VM (which you could check with wget or curl on the VM IP address which you should be able to find using the docker desktop, or you could use the VM console and try wget or curl on http://localhost:8080)You may need to ... |
Using docker environment -e variable in supervisor | I've been trying to pass in an environment variable to a Docker container via the-eoption. The variable is meant to be used in a supervisor script within the container. Unfortunately, the variable does not get resolved (i.e. they stay for instance$INSTANCENAME). I tried${var}and"${var}", but this didn't help either. Is... | The variable is being passed to your container, but supervisor doesn't let use environment variables like this inside the configuration files.You should review thesupervisor documentation, and specifically the parts about string expressions. For example, for thecommandoption:Note that the value ofcommandmay include Pyt... |
How to configure docker/docker-compose to use Nexus by default instead of docker.io? | I'm trying to use TestContainers to run JUnit tests.
However, I'm getting aInternalServerErrorException: Status 500: {"message":"Get https://registry-1.docker.io/v2/: Forbidden"}error.Please note, that I am on a secure network.I can replicate this by doingdocker pull testcontainers/ryukon the command line.$ docker pull... | Since the version1.15.1Testcontainers allow to automatically append prefixes to all docker images. In case your private registry is configured as a docker hub mirror this functionality should help with the mentioned issue.Quote from thedocumentation:You can then configure Testcontainers to apply the prefix registry.myc... |
Multicontainer docker (AWS) link is one-way? | I'm getting asymmetrical container discoverability with multicontainer docker on AWS. Namely, the first container can find the second, but the second cannot find the first.I have a multicontainer docker deployment on AWS Elastic Beanstalk. Both containers are running Node servers using identical initial code, and are b... | I got a response from AWS support on the topic.The links are indeed one-way, which is an unfortunate limitation. They recommended taking one of two approaches:Use a shared filesystem and write the IP addresses of the containers to a file, which could then be used by your application to access the containers.Use AWS Far... |
Headless protractor not sharding tests | I am trying to run my tests headless and shard both my test suites to run them in parallel. On my local machine they run in parallel, but in this headless setup they run one after the other. I am using Docker images for the web driver and protractor.I am using the webnicer-protractor Docker image:https://hub.docker.com... | Protractorheadless testing on real Google Chrome browser is now possible since Chrome >= 57, Chromedriver >= 2.29 along some basic config:capabilities: {
browserName: 'chrome',
chromeOptions: {
args: ['headless', 'window-size=1920,1080']
}
}Another cool thing is that the window size is not limited t... |
Is it possible to start multi physical node hadoop clustster using docker? | I've seen searching for a way to start docker on multiple physical machines and connect them to a hadoop cluster, so far I only found ways to start a cluster locally on 1 machine. Is there a way to do this? | You can very well provision a multinode hadoop cluster with docker.Please look at some posts below which will give you some insights on doing it:http://blog.sequenceiq.com/blog/2014/06/19/multinode-hadoop-cluster-on-docker/Run a hadoop cluster on docker containers |
does the FROM directive in a dockerfile allways pull the latest version of an image | If I have a Dockerfile:FROM ubuntu/latestand ubuntu update their image in the public registry. When I rundocker build ., will it use the ubuntu that it got the first time or will it pull the new version? | No, it does not. AFROMdirective will use whatever happens to be available in your local image cache, unless you pass--pulltodocker build. |
Increase Docker container storage size on CentOS | I want to increase the disk space of a Docker container. Here is the output from docker info.Containers: 3
Running: 3
Paused: 0
Stopped: 0
Images: 4
Server Version: 19.03.5
Storage Driver: overlay2
Backing Filesystem: extfs
Supports d_type: true
Native Overlay Diff: trueI have read that the disk space is 10GB by defau... | I have read that the disk space is 10GB by default, supposedly this limit is dropped with overlay2. This does not seem to be the case for me.That is not accurate.Earlier releases of Docker used thedevicemapperstorage driver on CentOS, which creates a new virtual block device for each container. In this case, the defaul... |
Tomcat7 in debian:wheezy Docker instance fails to start | I'm trying to build a docker image for the first time using a debian image from Google (google/debian:wheezy), setting up OpenJDK7 on it and trying to setup Tomcat7.docker pull google/debian:wheezy
docker run -i -t google/debian:wheezy bashOnce I'm in bash, I install openjdk withapt-get update
apt-get install openjdk-7... | I tried your steps and was able to run tomcat just fine. I didn't get the problem with apt-get, so nowapt-get update --fix-missingwas required. I even started tomcat from the init.d script and it worked.My guess is, that either you had some network problems, or there were some problems with Debian's repositories, but t... |
precompiled golang on alpine | I'm trying to write a dockerfile that uses alpine and takes advantage of a precompiled golang.docker run -it alpine:latestwget https://dl.google.com/go/go1.12.9.linux-amd64.tar.gz --no-check-certificate
tar -C /usr/local/ -xzf go1*.tar.gzI'm getting /bin/sh/: ./go: not foundcd /usr/local/go/bin/
./goIt works fine on m... | Alpine is built using theMUSLC library. You cannot run binaries that have been compiled for glibc in this environment. You would need to find agobinary built explicitly for the Alpine platform (e.g. by runningapk add go). |
Chronos does not run job | I have set up Mesos Cluster including Marathon & Chronos using Docker image for each service.Docker images I am using are as follows;ZooKeeper:jplock/zookeeper:3.4.5Mesos Master:redjack/mesos-master:0.21.0Mesos Slave:redjack/mesos-slave:0.21.0Marathon:mesosphere/marathon:v0.8.2-RC3Chronos:tomaskral/chronos:2.3.0-mesos0... | Change--zk_hosts zk://:2181/mesosin your Chronos command-line to--zk_hosts :2181, since this is supposed to be a list of zk node:port pairs, so that Chronos can store its own state in a/chronosznode (as opposed to the/mesosznode, where Mesos stores its leading master info). |
Building Windows Containers with AWS CodeBuild | I'm getting started with the CI/CD functionality of AWS. To this point, I have been creating my docker image locally on Windows Server 2016, based on the microsoft/windowsservercore image, and manually pushing it to the ECR (amazon container registry).At this point, I'm not trying to compile the application in CodeBuil... | AWS CodeBuild does not support a Windows build environment, but it is in the works. You cansign up herefor notifications about CodeBuild support for Windows.However, CodeBuild runs all builds on Docker. Building Docker images in a Windows Docker container is not yet supported by Microsoft (seethis GitHub issue for de... |
GKE not able to reach MongoDB Atlas | I have an issue with trying to deploy my containerized app to GKE. It is not able to reach my MongoDB Atlas cluster. Running the Docker container locally creates no issues and works perfectly. I am by no means an expert in Docker or Kubernetes, but I am assuming it is something to do with the DNS name resolution.I have... | Exactly as @Marc point, your traffic got out with EXTERNAL-IP of your worker nodes, not your load balancer.To find nodes EXTERNAL-IP IPs use:kubectl get nodes -owideTo be more precise and output only IPs use (taken fromkubectl Cheat Sheet):kubectl get nodes -o jsonpath='{.items[*].status.addresses[?(@.type=="ExternalIP... |
How can OpenShift container learn its image ID? | I would like to add a configuration option to a proprietary, PostgreSQL-based Docker image for OpenShift 3.9 in the form of a template variableINITDB. The image provides a database that is backed by persistent storage, and from now on the database should only be initialized when that variable (flag) is set.The image is... | The suggestion towardshostnamereceived in one of the comments was on point. The following piece of code now serves as intended:file=/mnt/pgdata/hostname
if [ -n \"$INITDB\" ] && [ \"$(cat $file)\" != $(hostname) ]; then
initdb ...
echo $(hostname) > $file
fi |
Save artifacts from already running docker container | I'm completely new to Docker. I'm using it to train neural networks.I've got a running container, executing a script for training a NN, and saving its weights in container's writable layer. Recently I've realized that this setup is incorrect (I haven't properly RTFM), and the NN weights will be lost after the training ... | Have you tried usingdocker cp? That allows you to move files from the Docker filesystem to your host, even if the container is stopped (as long as it hasn't been removed). The syntax would look like the following:docker cp :/path/to/file/in/container /path/to/file/in/host |
How to seed a docker container in Windows | I intended to install a mongodb docker container fromDocker Hub, and then insert some data into it. Obviously, a mongodb seed container is needed. So I did the following:created aDockerfileof Mongo seed container inmongo_seed/Dockerfileand the code inDockerfileis the following:FROM mongo:latest
WORKDIR /tmp
COPY data/s... | Notice the errorls: cannot access '.'$'\r': No such file or directory.One of the issues with Docker (or any Linux/macOS based system) on Windows is the difference in how line endings are handled.Windows ends lines in a carriage return and a linefeed\r\nwhile Linux and macOS only use a linefeed\n. This becomes a problem... |
Why run Docker under Vagrant? | I've read multiple articles how to do this, but I can't figure out what the benefits are under macOS.From my point of view, you can run Docker natively on macOS using Docker Community Edition (boot2docker+Kitematic). What does it's give me for running from Vagrant, mobility? | My standard day to day development work is carried out in Docker For Mac/Windows as they cover about 95% of what I need to do with Docker. Since they replaced Docker Toolbox/boot2docker and made the integration to the OS pretty seamless I have found very few reasons to move over to another virtual machine. The two main... |
Prisma migration in a Docker - NestJS server | I am implementing a application using a NestJS server, working with a PostgreSQL database and the Prisma service to handle data.I have an issue when trying to run a Prisma migration when launching my service in my Dockerfile. Here is my docker-compose.yml file :version: '3.8'
services:
# POSTGRES
postgres:
con... | In your Compose file, you have avolumes:block that overwrites the image's code with content from the host. Delete this.services:
backend:
volumes: # <-- delete
- ./backend:/app # <-- deleteWhen this block is present, the/appdirectory in the container is the./backenddirectory in the host system.... |
How to audit the selinux denial inside a docker container | I have a docker container, when disable selinux, it works well;
but when enabled selinux (i.e. the docker daemon is started with --selinux-enabled), it can not start up.So the failure should caused by selinux denial, but this is not shown in the selinux audit log. when I use the "ausearch -m XXX | audit2allow ..." to g... | The policy likely containsdontauditrules.Dontauditrules do not allow acecss, but suppress logging for the specific access.You can disabledontauditrules withsemanage:semanage dontaudit offAfter solving the issue, you probably want to turn thedontauditrules back on to reduce log noise.It is also possible to search for po... |
Error response from daemon: login attempt to https://hub.docker.com/v2/ failed with status: 404 Not Found | When runningdocker login hub.docker.com
Username: bheng
Password: **********I kept gettingError response from daemon: login attempt tohttps://hub.docker.com/v2/failed with status: 404 Not FoundHow do I know what is my username ?I can log in into my docker hub fine with the same credentials.I've tried almost every combi... | Yes, your login isbheng, buthub.docker.com([SERVER]) is wrong. Correct server isindex.docker.io. Actually, it is default server, so you don't need to specify, so just use the simple command:docker login |
GitLab runner ignoring DOCKER_AUTH_CONFIG when credential helper specified | We have a GitLab CI pipeline that currently pulls images from our internal Docker registry, authenticated using a variable defined in.gitlab-ci.yml:variables:
...
DOCKER_AUTH_CONFIG: '{"auths": {"our.registry": {"auth": "$B64AUTH"}}}'This works fine.We are trying to add a step to the end of the pipeline, to push ou... | Our problems here boiled down to a number of causes:Since we referenced the credential helper inDOCKER_AUTH_CONFIG, we needed the helper installed on the machine spawning the runners. (We use thedocker+machinerunner.) This machine also needed IAM permissions. Without this, it just gave up on theDOCKER_AUTH_CONFIGvariab... |
Docker Container with Wiremock could not find stub mappings | Link to the Repo:https://github.com/wiremock/wiremock-dockerI'm getting an error when I try to access stubs, not sure if I'm missing anything here. Can I know if the below command is correct ?docker run --rm -d -p 8080:8080 -p 8443:8443 --name wiremock_demo \
-v $PWD:/home/wiremock \
rodolpheche/wiremock:2.25.1ERRO... | The mapping should be made to$PWD:/home/wiremock/mappingswherePWDhas the json files.Also json files should look like this:{
"mappings": [
{
"id": "679dd3ce-55e5-45ee-b270-01dcf1b371ca",
"request": {
"urlPattern": "^/hello",
"method": "GET"
},
"response": {
"status":... |
docker x509 certificate signed by unkown authority | I'm an absolute Beginner in Docker and install on my workstation ubuntu 16.04.3 the latest docker version successfully.But when I now try to do following:
docker run hello-world
Unable to find image 'hello-world:latest' locally
Pulling repository docker.io/library/hello-world
docker: Error while pulling image: Gethttps... | I found a solution with the update-ca-certificates: copy the root cert file into /usr/local/share/ca-certificates and run update-ca-certificates manpages.ubuntu.com/manpages/xenial/man8/… |
Docker in Google App Engine Flexible health check has wrong URL | My service uses a url like this:/v1/lookup_stuff/v1/is the base url for everything in the service, so when the health check pingsit gets a 404. I need to update to ping/v1/(Possibly useful information, the service is in Docker, and is accessible when I manually go to the right URL)How do I point gcloud's health service... | Update:The flexible environment now supports theUpdated health checks, consisting of separately configurableliveness checksand/orreadiness checks, both with a configurablepathcapability.Note that these updated health checks are not compatible and cannot coexit with the legacy health checks:You must enable updated healt... |
dynamically adding nginx container ip into phpfpm /etc/hosts file | Looking to automatically add the nginx container ip address inside my phpfpm container /etc/hosts file.Inside my yml file, I have a service called phpfpm, and I know you can use extra_hosts attribute to assign values into the /etc/hosts file, however I don't know how to dynamically call place the nginx container IP.ngi... | Containers within a compose file will run on same network and you can just their names.phpfpmandnginxin your case. Also if you need more names for the same service you need to use aliasesnginx:
build: ./nginx
ports:
- "80:80"
- "443:443"
volumes:
- ../public/:/var/www/html/public/
cont... |
How to share apt-package across Docker containers | I want to use docker to help me stay organized with developing and deploying package/systems using ROS (Robot Operating System).I want to have multiple containers/images for various pieces of software, and a single image that has all of the ROS dependencies. How can I have one container use the apt-packaged from my dep... | You can create your own images that serve you as base images using Dockerfiles.Example:mkdir ROSDocker
cd ROSDocker
vim Dockerfile-base
FROM debian:stretch-slim
RUN apt-get install dep1 dep2 depn
sudo docker build -t yourusername/ros-base:0.1 -f Dockerfile-base .After the build is complete you can create another dock... |
docker inside docker on windows | run jenkins with docker on windows, but how to run docker command in windows docker container?
in linux:docker run -it --rm --privileged --name dockerindocker -v //var/run/docker.sock:/var/run/docker.sock dockerAre there any similar commands available for docker in Windows 10? | Itlooks likethere's no Windows support for it.That would require some sort of support from Windows and is not something that they are working on. |
Error establish a database connection docker compose | I am trying to setupwordpresswithdocker. I have included my yaml file below. Here I have set my mariadb_database to db_tyre.When I hitdocker-compose up -d, it is creating all the required files of wordpress. This is also creating db_tyre database but when I try localhost:8000, it gives meError establishing a database c... | As mentioned in the comment, you should set update theHOSTbut still, it will not work, as the WordPress DB configuration does not seems correct.ENV for DB isMARIADB_ROOT_PASSWORD: password
MARIADB_DATABASE: db_tyre
MARIADB_USER: wordpress
MARIADB_PASSWORD: wordpressso the WordPress DB configuration sh... |
How to set Environment Variables from server in Docker Compose? | Is there a way to force docker compose to assume environment variables from the underlying machine?Background:I decided to play around with Docker in my ASP.NET Core Web Application, so I used theAdd Docker Supportoption in Visual Studio, which created a.dcproj(Docker Compose project).Prior to that, I was reading some ... | You have to specify the environment variables in thedocker-compose.ymlfile like thisenvironment:
- VAR1
- VAR2=fixedvalueIn this caseVAR1assumes the value that is defined for the variable in your computer andVAR2will assume the value that is specified regardless or what is configured in your computer.You also have ... |
How to pass only options with the CMD command? | Suppose there's an image outside of my control that specifies custom entry point. Let's call itserver# server's Dockerfile
ENTRYPOINT /usr/bin/serverI'm building an image based on the server. I'd like to specify a default command to be executed. It should call the server's entrypoint and pass an argument to it. The ar... | Commands are defined like:CMD [ "--port", "8080" ]Where otherwise the--portgets attached to the CMD command itself as a flag, not the actual command it runs.This presumes that theENTRYPOINTcan properly handle just options and doesn't require a path of an executable as is traditionally the case. |
Nginx redirect https->http(reverse proxy)->port(docker container) | ContextSimple setupA docker container exposing 8090 as a website (node, express)A nginx conf exposing 80 and mapping it to localhost 8090IssueI don't have paid SSL certificate, I want end users that try to reach https to be redirected to http.I have tried redirects, rewrite, and here below a simple listen.. without suc... | Using letsencrypt to get a free certificate and then either use https or redirect to http was the solution for me.Credits to @RichardSmith |
How to enable php extensions when using the image php:7.2-apache with docker-compose? | I want to run a apache webserver with php extension inside container using docker compose as deployment.My compose file looks like this:version: '3.1'
services:
php:
image: php:7.2-apache
ports:
- 8089:80
volumes:
- ./php/www:/var/www/html/how can I enable the following extensions.apache2
p... | First of all you can runphp -minphpcontainer to see installed and enabled modules.You can edit yourdocker-compose.ymllike this:version: '3.1'
services:
php:
# image: php:7.2-apache # remember to comment this line
build: .
ports:
- 8089:80
volumes:
- ./php/www:/var/www/html/Create a file c... |
Failed to get kubelets cgroup | Am trying to setupkubernetesincentosmachine, kubelets start is giving me this error.Failed to get kubelets cgroup: cpu and memory cgroup hierarchy not
unified. Cpu:/, memory: /system.slice/kubelet.service.The cgroup driver I mentioned is systemd for both docker and kubernetesDockerversion 1.13.1Kubernetesversion 1.15... | Thisissueis fixed in a commit but still not merged seethisyou may try this work around:sudo vim /etc/sysconfig/kubeletadd at the end of DAEMON_ARGS string:--runtime-cgroups=/systemd/system.slice --kubelet-cgroups=/systemd/system.slicerestart:sudo systemctl restart kubeletor :adding a file in :/etc/systemd/system/kubele... |
Expand ARG/ENV in CMD dockerfile | I have a Dockerfile and I am taking in a LAMBDA_NAME from a jenkins pipeline.I am passing in something like this: source-producerAnd I want to call the handler of this function, which is named handler in the code.This code does not workARG LAMBDA_NAME
ENV LAMBDA_HANDLER="${LAMBDA_NAME}.handler"
RUN echo "${LAMBDA_HANDL... | You need to use theshell formof the CMD statement. With theexec formof the statement, as you have now, there's no shell to replace environment variable.UseCMD "${LAMBDA_HANDLER}"instead.This is equivalent to this, using theexec form, which you can also use, if you prefer the exec formCMD [ "/bin/sh", "-c", "${LAMBDA_HA... |
Acessing ARP table of Host from Docker container | How can I access the host ARP records from within a Docker container?I tried to mount a volume (in a docker-compose file)/proc/net/arp:/proc/net/arpbut found out that I can't make any volume with/proc. Then I tried to mount it elsewhere like/proc/net/arp:/root/arp, but then if Icat /root/arp, from within the container... | You should be good if you add privileged mode and make sure you're in host networking mode. This worked for me:>$ docker run --net host --privileged -v /proc/net/arp:/host/arp alpine cat /host/arp |
I can't connect my ASP .NET app from Docker-container to my computer host database with "host.docker.internal:some-port" | I lost amount of time trying to connect my app container with my database Azure Cosmos DB Emulator. I am using loggers object to know where my app break, and I found that the problem is in the connection of the container out of him. I tried to use the famous host.docker.internal direction to connect my host but using m... | Unsing the following configuration withhost.docker.internal:8081it works."DocumentDb": {
"TenantKey": "Default",
"Endpoint": "https://host.docker.internal:8081",
"AuthorizationKey": "C2y6yDjf5/R+ob0N8A7Cgv30VRDJIWEHLM+4QDU5DE2nQ9nDuVTqobD4b8mGGyPMbIZnqyMsEcaGQy67XIw/Jw=="
},So using the container name lik... |
Using Volumerize to backup my docker volumes with scp ? | I have a couple of docker volumes i want to backup onto another server, using scp/sftp. I don't know how to deal with that so i decided to have a look atblacklabelops/volumerize GitHub project.This tool is based on the command line toolDuplicity. Dockerized and Parameterized for easier use and configuration.Tutorialis ... | The option--ssl-cacert-fileis only for host verification not for authentication.I have found this example on how to add pem files inside an scp command:scp -i /path/to/your/.pemkey -r /copy/from/path user@server:/copy/to/pathThe parameter-i /path/to/your/.pemkeycan be passed in blacklabelops/volumerize
with the env v... |
How to add airflow variables in docker compose file? | I have an docker compose file which spins up the local airflow instance as below:version: '3.7'
services:
postgres:
image: postgres:9.6
environment:
- POSTGRES_USER=airflow
- POSTGRES_PASSWORD=airflow
- POSTGRES_DB=airflow
logging:
options:
... | You should not add variables to the webserver, but to scheduler. If you are using LocalExecutor, the tasks are run in the context of Scheduler.Actually what tou should really do is to set all env variables to be the same for all the containers (this is explained herehttps://airflow.apache.org/docs/apache-airflow/stable... |
run container with containerd's ctr by means of uidmap to map to non-root user on the host | To better understand how to use the--uidmapwithctr, I've created a test container by means of the following steps. Thecontainerdversion is1.4.3.Build and Run Container:Build Dockerfile$ cat Dockerfile
FROM alpine
ENTRYPOINT ["/bin/sh"]with$ docker build -t test .
Sending build context to Docker daemon 143.1MB
Step 1/2... | I was searching for a while until I checked containerd's code and found this withincmd/ctr/commands/run/run_unix.go:149 if uidmap, gidmap := context.String("uidmap"), context.String("gidmap"); uidmap != "" && gidmap != "" {
150 uidMap, err := parseIDMapping(uidmap)
151 if err != nil {
152 ... |
Docker and conda - how does "clean --all -y" work? | I am bit confused by the conda commandconda clean --all -yinside a docker script.
Generally, the idea is to shrink the final docker image.conda clean --all -yshould help to delete downloaded tarballs, and indeed, the docker log shows:Will remove 430 (853.4 MB) tarball(s).However, the final image size is identical wheth... | This isn't acondaissue, but a Docker issue. The layers in a Dcoker image are read-only; you can't modify them. When you create an image with something likeRUN conda do_something
RUN conda clean --all -ywhatever the first command added to the image isfixedin that layer. The subsequent command doesn't remove anything fro... |
How to add jars from systempath in Docker | In my maven pom file I have some dependencies which are our own jar files from other projects which are not in repository.We have used 'system' scoped dependencies like
efaadmin
efaadmin
system
1.0
${basedir}\src\main\webapp\WEB-INF\lib\efaadmin.jar
Now when writing Dockerfile these dependencies have ... | This does not look like an issue with Docker, it looks like an issue with Maven. Maven requires an absolute path for system scope dependencies. You can test this is the case by commenting out all the lines of your Dockerfile below...
RUN mvn -f /home/app/pom.xml
# comment out everything below this, I think you'll sti... |
Running a Chainlink Node - Can't connect to database | Using docker-desktop on macOS.I'm trying to run a node following the instructions onthis page.The database name isnode, which is the same as the username:node. The user has access to the database and can log in usingpsqlclient.Connection strings I've tried in the .env file:postgresql://node@localhost/node
postgresql://... | The problem is with docker networking.Add--network hostto the docker run command so that it is:cd ~/.chainlink-kovan && docker run -p 6688:6688 -v ~/.chainlink-kovan:/chainlink -it --env-file=.env smartcontract/chainlink --network host local nThis fixes the issue. |
Dockerized executable read/write on host filesystem | I just dockerized an executable that reads from a file and creates a new file in the very directory that file came from.I want to use Docker in that setup, so that I avoid installing numerous third-party libraries in the production environment.My problem now: I have file/this/is/a.fileon my underlying (host) file syste... | You're correct, you need to pass in/this/isas a volume and the executable will write to that location.If you want to constrain the thing even more, you can pass/this/is/b.fileas a volume. You need to create it (simply viatouch) beforehand, otherwise Docker will consider it a directory and create it as such for you, but... |
How do I configure a secret in docker compose? | I have a simple docker compose that makes use of a secret. However I have been unable to access the secret. The logs show the/run/secrets/usernamebeing passed in the server but not the actual username. What's wrong with my setup? How do I get the secret value from DB_USERNAME within my service?version: "3.9"
services:... | Setting a secret only exposes that value at a filesystem location under/run/secrets. If you want to get that value into a variable, you would need to do that yourself as part of your container startup.For example, anENTRYPOINTscript like that this would make/run/secrets/usernameavailable asDB_USERNAME:#!/bin/sh
if [ -... |
File not found in Docker Container using GitLab-CI | Using GitLab-CI, I am attempting to echo a secret variable into a file inside a Docker container. The file exists and the user has permissions to write to the file yet I get aNo such file or directoryerror.$ /usr/bin/docker exec -t $CI_PROJECT_NAME ls -la /opt/application/conf/kubeadminaccount.yml
-rw-rw-r-- 1 node... | Your redirection operator is working on host and not inside your container. Change below$ /usr/bin/docker exec -t $CI_PROJECT_NAME echo $KUBE_ADMIN_ACCOUNT > /opt/application/conf/kubeadminaccount.ymlto$ /usr/bin/docker exec -t $CI_PROJECT_NAME bash -c "echo $KUBE_ADMIN_ACCOUNT > /opt/application/conf/kubeadminaccount.... |
docker nginx not loading css styles | When uploading static files to my server using Nginx as the web server my css, javascript, and google fonts are not working as they do when testing the site on localhost.I'm running Nginx in a docker container using the base image.DockerfileFROM nginx
COPY example.com.conf /etc/nginx/nginx.conf
COPY build /etc/nginx/ht... | With the help of thisSO answerand the comments I was able to get it working. If my answer doesn't help you I suggest you look at that one when running Nginx in a docker container.For me it was moving theinclude /etc/nginx/mime.types;and addingsendfile on;outside myserverblock and in thehttpblockMy example.com.conf now ... |
Build Specific Dockerfile from set of dockerfiles in github action | Consider we Have 10 Docker files but i made some changes only in 1 Docker file.so In Github action we generally build all 10 docker files instead of 1 docker file.
So Is there any way to write conditions such that github actions should build that particular dockerfile which we made changes. | You can try to use this github action:https://github.com/trilom/file-changes-actionGo over the docs to see how to use it. But basically an example would be similar to this:- name: Get file changes
id: get_file_changes
uses: trilom/[email protected]with:
githubToken: ${{ secrets.GITHUB_TOKEN }}
... |
Unable to start the server using docker command - Mount directory -OCI Runtime error | I would like to start the orthanc server based on the below docker command. However when I execute the command, I get the error as shown below.Please note that both the orthanc.json and orthanc-db are present in the respective folders/orthanc/orthanc.json- orthanc.json is present under orthanc folder/orthanc/orthanc-db... | You are running the container from the same directory where your folders are (the ones you are mounting). This means that the path should be prefixed with the current working directory:docker run -p 4242:4242 -p 8042:8042 --rm --name orthanc -v $(pwd)/orthanc/orthanc.json:/etc/orthanc/orthanc.json -v $(pwd)/orthanc/ort... |
docker with maven jar | I'm running a maven project in a docker container, I'm getting Could not find or load main class error.FROM maven:3.6.0-jdk-11-slim AS build
COPY src src
COPY pom.xml .
RUN mvn -f pom.xml clean package install
FROM openjdk:8-jre
COPY --from=build /target /opt/target
WORKDIR /target
RUN ls
CMD ["java", "-jar", "Cus... | It's not a Docker issue it's a Java issue. There are several ways to define classpath entries to run an executable jar.Shaded or Uber jar approachIn this case you sould create a shaded jar which contains all dependent classes in one executable jar file. Maven has a plugin calledApache Maven Shade Pluginto create that u... |
install ffmpeg on amazon ecr linux python | I'm trying to install ffmpeg on docker for amazon lambda function.
Code for Dockerfile is:FROM public.ecr.aws/lambda/python:3.8
# Copy function code
COPY app.py ${LAMBDA_TASK_ROOT}
# Install the function's dependencies using file requirements.txt
# from your project folder.
COPY requirements.txt .
RUN yum install ... | Since the ffmpeg package is not available with yum package manager, I have manually installed ffmpeg and made it part of the container. Here are the steps:Downloaded the static build fromhere(the build for thepublic.ecr.aws/lambda/python:3.8 image is ffmpeg-release-amd64-static.tar.xzHereis a bit more info on the topic... |
Enable credentials in puckel/docker-airflow | I am usingpuckel/docker-airflowto deploy airflow.
Currently, the webserver is not asking for any credentials to login.
How can I add a user to it? Maybe i have to add some environment variable in docker-compose.yml, but i am unable to find it. The docker-compose file ishereThanks in advance. | Create your own airflow.cfg (Assume it is stored in./config/airflow.cfg) and followAirflow Security Guideto define credential.Then, mount your config file to docker container can help you, add./config/airflow.cfg:/usr/local/airflow/airflow.cfgto yourwebserverdocker composeExample:volumes:
- ./dags:/usr/local/airf... |
How to restart Python Docker Container from inside | My Objective:I want to be able to restart a container based on the official Python Image using some command inside the container.My system:I have a own Docker image based on the official python image which look like this:FROM python:3.6.15-buster
WORKDIR /webserver
COPY requirements.txt /webserver
RUN /usr/local/bin/py... | Well, in the end the solution wasmuch simplerthan I expected.I started from the base where I mount the docker socket inside the container (I know that this practice is not recommended, but in my case, I know that it does not pose security problems), using the command in docker-compose:volumes:
- /var/run/docker.sock:... |
Docker flask - jinja2.exceptions.TemplateNotFound: index.html | New to docker and trying to run a flask mysql app but getting a jinja2.exceptions.TemplateNotFound: index.html . No errors if I runpython app.pyoutside of dockerDirectory structure-docker-compose.yml
-app
-templates
-index.html
-app.py
-Dockerfile
-requirements.txt
-db
-init.sqldocker... | YourDockerfileonly copiesrequirements.txtandapp.pyinto the image. In order for the dockerizedapp.pyto have access totemplatesand its contents, you need to copytemplatesas well by adding the line:COPY templates /app/ |
IntelliJ cannot connect to protected tcp Docker socket | I want to use theDocker integration in IntelliJto connect to a protected remote Docker socket:As you can see in the above picture I'm getting the following error:Cannot connect: java.io.IOException: Channel disconnected before any data was receivedWhen I set the Dockerenvironment variablesDOCKER_TLS_VERIFY=1,DOCKER_HOS... | The solution was like Kootli suggested in the comments to usehttpsinstead oftcpas protocol.Engine API URL:https://myhost:2376 |
Εxecute commands with args and override entrypoint on docker run | I am trying to override the entrypoint in adockerimage with a script execution that accepts arguments, and it fails as follows▶ docker run --entrypoint "/bin/sh -c 'my-script.sh arg1 arg2'" my-image:latest
docker: Error response from daemon: OCI runtime create failed: container_linux.go:380: starting container process ... | Remember that arguments after the container image name are simply passed to the ENTRYPOINT script. So you can write:docker run --entrypoint my-script.sh my-image:latest arg1 arg2For example, if I havemy-script.sh(mode0755) containing:#!/bin/sh
for arg in "$@"; do
echo "Arg: $arg"
doneAnd a Dockerfile like this:FRO... |
How to set up Apache2 and PHP-FPM via unix socket? | I try to set up Apache2 and PHP-FPM via unix socket but result is(111)Connection refused: AH02454: FCGI: attempt to connect to Unix domain socket /run/php/php7.2-fpm.sock (*) faileddocker-compose.ymlversion: "2"
services:
php:
build: "php:7.2-rc-alpine"
container_name: "php"
volumes:
... | Okie, so have the repo helped to fix the issue.Issue #1 - www.conf being copied in apache containerYou had below statement in your apache container DockerfileCOPY ./www.conf /usr/local/etc/php-fpm.d/www.confThis is actually intended for the php container which will be running php-fpm and not the apache containerIssue #... |
Issue getting docker to access my database properly with wordpress | I'm new to docker all together - but am trying to setup a local test environment to play with some wordpress things.So I went to the docker site and pulled up a default docker .yml file on how to get it going easily.I've made just a couple changes, but mostly this is a straight forward document.version: '3'
services:
... | So I think I got it.It wasreallysimple. In my wordpress portion of my .yml file I needed to includeWP_DB_NAME: testdatabaseBy doing that, it used my named testdatabase to install wordpress to.Hope this helps people who might stumble across this.Now the .yml file looks like this:version: '3'
services:
db:
image... |
NPM not found when using npm run start command within shell script from a docker container | I am not sure what I may be doing wrong but I have the followingscript.shfile sitting at the root of my project:script.sh#!/bin/sh
npm run start
envsubst '\$PORT' < /etc/nginx/conf.d/configfile.template > /etc/nginx/conf.d/default.conf
nginx -g 'daemon off;'Then I referenced the above script in myDockerfileas shown bel... | You're trying to run two separate programs, so run them in two separate containers.# Dockerfile.app
FROM node:16.14.2
WORKDIR /usr/src/app
COPY package*.json ./
RUN npm install --only=production
COPY . ./
ENV HOST 0.0.0.0
ENV NODE_ENV production
EXPOSE 8080
CMD npm run start# Dockerfile.nginx
FROM nginx:alpine
COPY ngi... |
How to install php-mcrypt in lando with php 7.2? | Following example inHow to install mcrypt on DockerI came to this:name: myapp
recipe: drupal7
config:
webroot: web
php: '7.2'
proxy:
pma:
- pma.myapp.lndo.site
services:
pma:
type: phpmyadmin
appserver:
extras:
- "apt-get update -y"
- "apt-get install libmcrypt-dev"
- "pecl install... | This is what you've missed:services:
appserver:
build_as_root:
- apt-get update -y
- apt-get install libmcrypt-dev
- pecl install mcrypt-1.0.1
- docker-php-ext-enable mcryptYou can use the following:name: myapp
recipe: drupal7
config:
webroot: web
php: '7.2'
proxy:
pma:
-... |
How to specify site-specific volumes for docker-compose | I'm working on a project with multiple collaborators; to share code and compute environment, we've setup a github repository which includes aDockerfileanddocker-compose.ymlfile. I can work on code and my collaborators can just pull the repository, rundocker-compose upand have access to my jupyter notebooks in the same ... | You are extremely close. What I would add is, that you have a host specific.envfile, seeEnvironment variables in Compose, on each computer, in the same folder as thedocker-compose.yml, withDATA_PATH=/mnt/shared/dataor whatever value forDATA_PATHyou like. Just add that.envto your.gitignore, so that every host keeps his ... |
How to remove an image across all nodes in a Docker swarm? | On the local host, I can remove an image using eitherdocker image rmordocker rmi.What if my current host is a manager node in a Docker swarm and I wish to cascade this operation throughout the swarm?When I first created the Docker service, the image was pulled down on each node in the swarm. Removing the service did no... | AFAIK there is no such option as of now. Each node is responsible of its own cleanup. There is a commanddocker system prune -fthat you can use to clear container data.But tagged images can be deleted usingdocker rmionly. See below issueshttps://github.com/moby/moby/issues/24079 |
NodeJS could not connect to MYSQL latest version inside Docker Container | NodeJS cannot connect to MySQL latest version or either 8 onwards and encountered following error message:ERROR: connect ECONNREFUSED 172.21.0.2:3306Here is my docker-compose fileversion: '2.1'
services:
db:
build: ./db
networks:
- ppshein
environment:
- MYSQL_ALLOW_EMPTY_PASSWORD=... | I've found a way to fix that authentication issue. I need to add following command--default-authentication-plugin=mysql_native_passwordandMYSQL_ROOT_PASSWORD=ppshein123456ondocker-composefile.command: --default-authentication-plugin=mysql_native_password
restart: always
ports:
- 3306:3306
environment:
- MYSQL_R... |
Instead of using existing docker volume, couchdb docker image always create new volume | In my ubuntu 18.04, installed couch db usingthis repo. In order to data persistance, i have created docker volume using the commanddocker volume create --name couchdbvolume.I useddocker run -p 5984:5984 -d couchdb -v couchdbvolume:/opt/couchdb/data --name some-couchdbcommand to create new docker process. Instead of usi... | According to thedocumentation, options should precede the image name.$ docker run [OPTIONS] IMAGE[:TAG|@DIGEST] [COMMAND] [ARG...]please try the following:docker run -p 5984:5984 -d -v couchdbvolume:/opt/couchdb/data --name some-couchdb couchdb |
Pycharm 2022 cannot connect to the docker service. It does not find it | I have Pycharm 2022 and when configuring a docker Python interpreter, Pycharm is not able to find the remote docker service, it seems that it cannot find it although the service is running (and I have the pro license):Loaded: loaded (/lib/systemd/system/docker.service; enabled; vendor preset: enabled)
Active: active (... | Appart from the official "solution" from Intelillj I find it easier with this workaround:Help -> Find Action -> RegistryDisablepython.use.targets.apiTry to configure the interpreter againThere is an official solution from Intelillj that you can check here:https://intellij-support.jetbrains.com/hc/en-us/community/posts/... |
How do I pass default CMD to ENTRYPOINT with variable expansion? | I'm trying to useENTRYPOINTandCMDsuch thatENTRYPOINTis the script I am calling andCMDprovides the default arguments to theENTRYPOINTcommand but will be overridden by any arguments given todocker run.The part I'm struggling with is how to have environment variable expanded in my default arguments usingCMD.For example. G... | Found the magic. I don't completely follow what's going on here but I'll try to explain itFROM busybox
ENV AVAR=hello
ENV AVAR2=world
ENTRYPOINT ["/bin/sh", "-c", "echo $(eval echo $@)", "$@"]
CMD ["${AVAR}", "${AVAR2}"]
docker run -it --rm test
> hello world
docker run -it --rm test world
> worldMy attempt at explan... |
How to install a custom container with latest Python + JupyterLab version? | How to create a custom Docker container to use with Google Workbench and connect to Proxy?Create the following DockerfileFROM python:3.11.3-bullseye
# Install JupyterLab and any other required packages
RUN pip install jupyter -U && pip install jupyterlab
# Expose the JupyterLab port
EXPOSE 8080
ENV pwd=""
ENTRYPOIN... | Just as a reference, this post answers the question submittedherewhere a policy organization does not allow external internet access, limiting package installation and/or using different Python verions in Vertex AI. |
Unzip local file and delete original in Dockerfile image build | I'm trying to uncompress a file and delete the original, compressed, archive in myDockerfileimage build instructions. I need to do this because the file in question is larger than the2GBlimit set by Github on large file sizes (seehere). The solution I'm pursuing is to compress the file (bringing it under the2GBlimit), ... | ADDonly decompresses local tar files, not necessarily compressed single files. It may work to package the contents in a tar file, even if it only contains a single file:ADD ./data/databases/file.tar.gz /data/databases/(cd data/databases && tar cvzf file.tar.gz file.db)
docker build .If you're using the first approach,... |
How to edit /etc/hosts in Azure Container Instances? | I try to edit /etc/hosts through the echo IP Hostname >> /etc/hosts command, but it seems that ACI rewrites the file.
I've already tried putting it in dockerfile and also through the --command-line but none works. | With Docker, it will manage the/etc/hostsfor you when you execute the Docker CLIdocker run, seeManaging /etc/hosts:Your container will have lines in /etc/hosts which define the hostname
of the container itself as well as localhost and a few other common
things.And for Azure Container Instance, specify a command lin... |
Nginx -- static file serving confusion with root & alias | I need to serve my app through my app server at8080, and my static files from a directory without touching the app server.# app server on port 8080
# nginx listens on port 8123
server {
listen 8123;
access_log off;
location /static/ {
# root... | There is a very important difference between therootand thealiasdirectives. This difference exists in the way the path specified in therootor thealiasis processed.rootthelocationpart is appended torootpartfinal path =root+locationaliasthelocationpart is replaced by thealiaspartfinal path =aliasTo illustrate:Let's say w... |
Where can I find the error logs of nginx, using FastCGI and Django? | I'm using Django withFastCGI+ nginx. Where are the logs (errors) stored in this case? | Errors are stored in the nginx log file. You can specify it in the root of the nginx configuration file:error_log /var/log/nginx/nginx_error.log warn;On Mac OS X withHomebrew, the log file was found by default at the following location:/usr/local/var/log/nginx |
(13: Permission denied) while connecting to upstream:[nginx] | I am working with configuring Django project with Nginx and Gunicorn.While I am accessing my portgunicorn mysite.wsgi:application --bind=127.0.0.1:8001in Nginx server, I am getting the following error in my error log file;2014/05/30 11:59:42 [crit] 4075#0: *6 connect() to 127.0.0.1:8001 failed (13: Permission denied) w... | DisclaimerMake sure there are no security implications for your use-case before running this.AnswerI had a similar issue getting Fedora 20, Nginx, Node.js, and Ghost (blog) to work. It turns out my issue was due toSELinux.This should solve the problem:setsebool -P httpd_can_network_connect 1DetailsI checked for errors ... |
NGinx Default public www location? | I have worked with Apache before, so I am aware that the default public web root is typically/var/www/.I recently started working with nginx, but I can't seem to find the default public web root.Where can I find the default public web root for nginx? | If your configuration does not include aroot /some/absolute/path;statement, or it includes one that uses a relative path likeroot some/relative/path;, then the resulting path depends on compile-time options.Probably the only case that would allow you to make an educated guess as to what this means for you would be, if ... |
nginx error connect to php5-fpm.sock failed (13: Permission denied) | I update nginx to1.4.7and php to5.5.12, After that I got the502 error. Before I update everything works fine.nginx-error.log2014/05/03 13:27:41 [crit] 4202#0: *1 connect() to unix:/var/run/php5-fpm.sock failed (13: Permission denied) while connecting to upstream, client: xx.xxx.xx.xx, server: localhost, request: "GET /... | I had a similar error after php update. PHP fixed asecurity bugwhereohadrwpermission to the socket file.Open/etc/php5/fpm/pool.d/www.confor/etc/php/7.0/fpm/pool.d/www.conf, depending on your version.Uncomment all permission lines, like:listen.owner = www-data
listen.group = www-data
listen.mode = 0660Restart fpm -sudo ... |
Nginx location priority | What order do location directives fire in? | From theHTTP core module docs:Directives with the "=" prefix that match the query exactly. If found, searching stops.All remaining directives with conventional strings. If this match used the "^~" prefix, searching stops.Regular expressions, in the order they are defined in the configuration file.If #3 yielded a match,... |
Kubernetes service external ip pending | I am trying to deploy nginx on kubernetes, kubernetes version is v1.5.2,
I have deployed nginx with 3 replica, YAML file is below,apiVersion: extensions/v1beta1
kind: Deployment
metadata:
name: deployment-example
spec:
replicas: 3
revisionHistoryLimit: 2
template:
metadata:
labels:
app: nginx
... | It looks like you are using a custom Kubernetes Cluster (usingminikube,kubeadmor the like). In this case, there is no LoadBalancer integrated (unlike AWS or Google Cloud). With this default setup, you can only useNodePortor an Ingress Controller.With theIngress Controlleryou can setup a domain name which maps to your p... |
How to clear the cache of nginx? | I use nginx to as the front server, I have modified the CSS files, but nginx is still serving the old ones.I have tried to restart nginx, to no success and I have Googled, but not found a valid way to clear it.Some articles say we can just delete the cache directory:var/cache/nginx, but there is no such directory on my... | I had the exact same problem - I was running my nginx in Virtualbox. I did not have caching turned on. But looks likesendfilewas set tooninnginx.confand that was causing the problem. @kolbyjack mentioned it above in the comments.When I turned offsendfile- it worked fine.This is because:Sendfile is used to ‘copy data be... |
Subsets and Splits
No community queries yet
The top public SQL queries from the community will appear here once available.