7

The Dockerfile specifies how a container image is built. The Dockerfile’s RUN command is trying to ping the db container, which is not yet running during the build phase. Once the container images have been created, compose will start the containers and they will be able to address each other via their service names (db and web). To accomplish what you want,...


6

Just a quick follow-up on pumba. Installation (for Ubuntu): $ curl -SL https://github.com/alexei-led/pumba/releases/download/0.7.2/pumba_linux_amd64 -O $ sudo mv pumba_linux_amd64 /usr/bin/pumba $ sudo chmod +x /usr/bin/pumba $ pumba --version It uses stress-ng under the hood, so same commands apply. Examples: $ pumba stress -d 1m container_name -d 1m - ...


5

Im heavily investigating this, and like many people, im discovering that in 2020 there doesn't seem to be so much logic in separating tightly coupled webserver + PHP + app process/code from each other: Two main arguments for separation are scalability and separation of concerns (one process per container). Logically the webserver should only act as webserver ...


4

As for the tool kind of a thing, I think you're looking for something like pumba


4

I've found sometimes I need docker-compose build --no-cache if I have a bad deploy.


4

Docker compose is still a comparatively easy and light-weight tool to run multiple docker containers with service discovery. Kubernetes is a metaphorical elephant. Great if you need to smash Roman lines and win the battle, but overkill for a minor skirmish, and definitely more trouble than it's worth if you're trying to fight a small battle in the mountains....


3

It is possible via network name: networks: mynetwork: name: ${STAGE_NAME} where mynetwork - name "inside" stack ${STAGE_NAME} -name for other stacks/services/containers See comment from docker capitan https://github.com/moby/moby/issues/40819#issuecomment-618726892


3

You could use the command rabbitmq-diagnostics -q ping in case you just need a basic check. healthcheck: test: rabbitmq-diagnostics -q ping interval: 30s timeout: 30s retries: 3 More information on how to run more advanced health checks could be found here


3

The problem is that the date format isn't ideal. Supported formats for date formatted time stamps include RFC3339Nano, RFC3339, 2006-01-02T15:04:05, 2006-01-02T15:04:05.999999999, 2006-01-02Z07:00, and 2006-01-02 Reference: https://docs.docker.com/engine/reference/commandline/system_prune/#filtering So this is really just a half answer, since it will use ...


3

Docker can either run the command using the equivalent of the OS exec syscall directly in the kernel, or it can run a shell (typically /bin/sh) to call your command. A shell provides functionality you are accustom to from the command line, including: I/O redirection and pipes (>, >>, <, etc) Command chaining (&& and ||) Variable ...


3

If you want a DNS lookup of one domain to resolve to another one, you have 2 options. Modify the Container /etc/hosts file. By default any DNS lookup is done there. You schould do that in the Dockerfile. Modify /etc/hosts in a Dockerfile Maintain your own DNS servers with all mapping records. On container runtime just pass the DNS server. Docker docs ...


3

The "official" nginx image has a specific path where it looks for files. You can either copy a file into the image by creating a new image from it or mount your files into this path as a volume. To copy files, have a folder with your index.html and a Dockerfile that looks like this: FROM nginx COPY index.html /usr/share/nginx/html Then build a new ...


2

In majority of circumstances I wouldn't recommend this in production, but to restart docker container from another container, you need to install docker in that container and then run that "master" container with docker run -v /var/run/docker.sock:/var/run/docker.sock as described here: https://jpetazzo.github.io/2015/09/03/do-not-use-docker-in-docker-for-...


2

Using docker-compose version 3.3 extensions and with the long variants for ports & volumes: version: '3.3' services: s1: &s build: . ports: - published: 5001 target: 9000 volumes: - source: ../www1 target: /var/www s2: <<: *s ports: - published: 5002 volumes: - source: ../www2 s3: &...


2

Add a config file with parameters used in install/run script. You can look at Harbor (Github, install docs) as an example of doing just that (and they have a configuration migrator).


2

Is there a way to know if an app has crashed inside docker If your app is writing logs and is the main process in that container, then yes, just watch them am implementing CI/CD and want to stop container when it crashes on auto-deploy What's your tools used for CI/CD? For example, when you are releasing an app with kubectl apply you can wait till ...


2

The layer that you're missing is nginx proxy. See my toy Mafia Game project here how to do it: Shell deployment project (uses either Docker compose or k8s) - https://github.com/taleodor/mafia-deployment Vue.js frontend - https://github.com/taleodor/mafia-vue Express.js backend - https://github.com/taleodor/mafia-express (Optional) detailed write-up about CI/...


2

One way to use curl inside the container will be to use a custom Dockerfile to build you postgrsql container. Just use the image: postgres:12-alpine as the base image of your Dockerfile and install curl in alpine with the following command : RUN apk --no-cache add curl


2

Try to read logs as follows: docker logs -f <container-name or container-ID> 2>&1 [NOTE]: -f option follows live logs. 2>&1 makes output as stdout and stderr which is useful for grepping and standardizing.


2

Yes, it's absolutely reasonable and this is how real apps work. This is the microservice approach which allows to independently scale instances of a service and a DB. What you have to do is to run your Flask and Redis services in a way so the first one can achieve the second one. If they are on the same machine, you just have to open Redis port used by your ...


2

To copy into the image or to mount volumes--my advice: if the files will change infrequently, then copy them into the image, with the understanding that if they need to be modified, you will need to rebuild the image. if you need to frequently change the files, or store some kind of state about the files (and re-use them with future container instances of ...


1

In your Dockerfile: ARG UID=1000 ARG GID=1000 RUN usermod -u $UID node && groupmod -g $GID node Then using docker build: docker build --build-arg UID=$(id -u) --build-arg GID=$(id -g) . The ARG lines provide defaults. If you leave off the --build-arg flags, they will be used. If you do use the --build-arg flags values those will be used instead.


1

I'm still fairly new to the Docker game, too, but I've got a few little projects that I do exactly what you are asking about. Through my own experience with trial & error (mostly error...) I would suggest using a docker-compose.yml with your network set to static internal IPs so each container will have predictable, repeatable results and IPs that you ...


1

I'm a bit new to Docker as well, but are you 100% certain that you performed a Docker push and your commit of your docker image that you're building with composer? And you have matching versions on the remote and your local machine? I'm also not seeing where you are mounting the '~/.guacamole/lib' path in your docker-compose.yml under volumes:


1

Since I do not currently have access to a server with Centos installed, I tested my soultion on Ubuntu 20.04. That being said, the whole point of using Docker is to make applications distribution-agnostic, so it should work on Centos as well. You're getting an image does not exist error, because the image you specified does not, in fact, exist. There is a ...


1

I fixed the issue. In my case, it was PORT (absolutely) and HOST (maybe) environment variables I defined manually in the GitLab CI/CD Variables section. It seems PORT and maybe HOST are two reserved environment variables for GitLab and/or Docker. By the way, I couldn't find anything in docs state not using those variables names.


1

I was able to produce a correct behaviour starting from centos:centos7 base image and installing Docker only (no Jenkins yet) via the steps provided in the official Docker docu: https://docs.docker.com/engine/install/centos/ Seen here: [root@d8d441ae6a7a /]# history 2 yum remove docker docker-client docker-client-...


1

Based on your output, all of your docker commands are running as root when in general they should be running as the jenkins user. You can try switching the user to jenkins and running the same docker login and pull commands. I've used the following in my Jenkins pipeline scripts to log into a Nexus 3 Docker repository (https://docs.cloudbees.com/docs/admin-...


1

Is this what you are trying to do? $ docker run --add-host foo:127.0.0.42 alpine ping foo -c 3 PING foo (127.0.0.42): 56 data bytes 64 bytes from 127.0.0.42: seq=0 ttl=64 time=0.045 ms 64 bytes from 127.0.0.42: seq=1 ttl=64 time=0.061 ms 64 bytes from 127.0.0.42: seq=2 ttl=64 time=0.070 ms --- foo ping statistics --- 3 packets transmitted, 3 packets ...


1

The extra_hosts setting in docker-compose might help you. Docs


Only top voted, non community-wiki answers of a minimum length are eligible