docker-compose change name of main container

When refering to your main container, you are probably refering to the project name, which you could usually set via the -p flag. (See other answers) For docker-compose, you can set the top level variable name to your desired project name. docker-compose.yml file: version: “3.9” name: my-project-name services: myService: … If you are using Docker … Read more

Enable “progress plain” in docker-compose file

Where you don’t want to disable buildkit, one can use BUILDKIT_PROGRESS=plain docker compose build # or BUILDKIT_PROGRESS=plain docker-compose build or without buildkit which serves plain progress by default DOCKER_BUILDKIT=0 docker compose build # or DOCKER_BUILDKIT=0 docker-compose build using docker desktop 20.10.8 + docker-compose 2.0.1

Docker-Compose Environment-Variables blank string

Although the other answers are both correct they do not highlight the underlying misunderstanding here enough: With the env_file option you can specify a file with variables to be injected into the environment in the container. Using variable substitution in the docker-compose.yml you can access variables in the environment of the docker-compose command, i.e. on … Read more

Docker-compose: /usr/local/bin/docker-compose : line 1: Not: command not found

UPDATE: 20230829 Fixed Automating download of latest release of docker-compose Last update of curl apparently didn’t like my script to automate the download of the latest release of docker-compose. So here’s the re-jiggered script which is tested and known to work with Ubuntu 22.04.3. Since GitHub doesn’t like IPv6, I forced IPv4 in the curl … Read more

Using multi-line value in .env file in docker-compose

If you don’t mind not using the .env file (maybe that environment variable is used only in a single container). You can define environment variables directly inside docker-compose.yml and there, you can make full use of YAML formatting options. I.e.: myservice: build: . environment: SSH_KEY: > ——— WHATEVER ———- randomkeybase64thingforyourse rvice ——- END WHATEVER ——– … Read more

What’s the difference between pm2 and pm2-runtime?

The main difference between pm2 and pm2-runtime is pm2-runtime designed for Docker container which keeps an application in the foreground which keep the container running, pm2 is designed for normal usage where you send or run the application in the background. In simple words, the life of the container is the life of CMD or … Read more