As of docker-compose version 3.0 and later, you can just use the hostname
key:
version: "3.0"
services:
yourservicename:
hostname: your-name
More Related Contents:
- Docker Compose wait for container X before starting Y
- How to fix docker: Got permission denied issue
- Using Docker-Compose, how to execute multiple commands
- What is the difference between docker-compose ports vs expose
- How to mount a single file in a volume
- Docker: How to clear the logs properly for a Docker container?
- Provide static IP to docker containers via docker-compose
- Docker : Can a container A call an executable located on an other container B?
- How to specify Memory & CPU limit in docker compose version 3
- How to pass arguments within docker-compose?
- How do I mount a host directory as a volume in docker compose
- What is the difference between ports and expose in docker-compose?
- How to use environment variables in docker-compose?
- Why the “none” image appears in Docker and how can we avoid it
- How to mount local volumes in docker machine
- Is it safe to clean docker/overlay2/
- Connect to Kafka on host from Docker (ksqlDB)
- Using docker-compose with CI – how to deal with exit codes and daemonized linked containers?
- Kafka access inside and outside docker [duplicate]
- How do I configure docker compose to expose ports correctly?
- Where is a log file with logs from a container?
- docker-compose build environment variable
- How to pass arguments to a Dockerfile?
- Pass argument to docker compose
- Docker-compose exit code is 137 when there is no OOM exception
- Docker 1.10 access a container by its hostname from a host machine
- Connect to another container using Docker compose
- Difference between “docker compose” and “docker-compose”
- how to get docker-compose to use the latest image from repository
- How to stop all containers when one container stops with docker-compose?