by Devin Yang
(This article was automatically translated.)

Published - 6 years ago ( Updated - 6 years ago )

foreword

This article introduces why the docker-compose ps official command cannot list all the services in use when we use D-Laravel's .env to load multiple yml files.
But the ./console ps on D-Laravel can indeed display normally, so how can the official docker-compose command be used to have the same effect?

docker-compose small classroom

First of all, when we use docker-compose up -d or docker-compose down , it will grab the docker-compose.yml file in the directory by default.

docker-compose actually provides the -f parameter, allowing us to use multiple yml files and non-default names.
In the example below, two yaml files are started at the same time through -f.


At this time, docker-compose ps you may find that the service of reids cannot be seen because two different yml files are in different directories.
Therefore, if we need to view the ps of redis , we need to add -p to represent the name of the project (the default is the directory name).
Or complete command -f docker-compose-random.yml -f service/redis.yml


Below, let's take a look at what D-Laravel provides, ./console ps ,
When matching .env, how to help us get the ps display of multiple yaml files, is it much more convenient? In the figure below, you will see that if you just use
When you docker-compose ps, you can't see the program for redis.

Original official instructions : (Only two yml files are listed here, what if we want to load more yml files??)
docker-compose -f docker-compose.yml -f service/redis.yml ps

After simplification through ./console: ( D-Laravel with .env, is it so simple to explode )
./console ps


 

Tags: docker

Devin Yang

Feel free to ask me, if you don't get it.:)

No Comment

Post your comment

Login is required to leave comments

Similar Stories


docker

Docker antivirus strategy

I just watched Story of Yanxi Palace recently, so I wanted to introduce a MacOS anti-drug strategy. This article teaches you how to use Docker to clean MacOS. Briefly introduce how we use anti-virus software to scan viruses through docker. It is assumed that my current directory is in my home directory, so ${PWD} is the current directory and will be mounted to the scan folder in the container. Therefore, when you use clamscan -r /scan/, you can scan all the files. Adding the -r parameter will use the recursive method to enter the subdirectory layer by layer to scan.

docker,cli

Docker container formatted display

I think if you want to write some automation functions, it may be useful to be able to format the output container content. The following are some reference examples of Docker container formatting and display instructions

d-laravel,docker

D-Laravel v1.2.1 version change description (recommended update, must avoid stepping on thunder)

D-Laravel v1.2.1 revision instructions use GuzzleHttp\Client; When posting, there is an access denied problem. If you are upgrading from an older version, you may need to adjust the configuration file in etc/default-ssl.conf (if there is one) Please adjust php:9000 to web:9000, you can adjust it by executing ./console secure once. In the docker-compose configuration file, change the PHP-FPM container to network_mode: "service:web"...