Usage with Docker
See original GitHub issueIn order to use it with Docker and docker-compose,
place it alongside Dockerfile, build it into the image with exec permissions and reference it in docker-compose.yml.
- Dockerfile
- wait-for-it.sh
#Dockerfile
...
COPY wait-for-it.sh /wait-for-it.sh
RUN chmod +x /wait-for-it.sh
...
#docker-compose.yml
...
my-service:
build:
context: "."
container_name: my_container
command: ["/wait-for-it.sh", "mysql:3306", "--", [entrypoint function]]
...
Issue Analytics
- State:
- Created 6 years ago
- Reactions:41
- Comments:16
Top Results From Across the Web
Overview | Docker Documentation
When running a container, it uses an isolated filesystem. This custom filesystem is provided by a container image. Since the image contains the...
Read more >A Docker Tutorial for Beginners
The key benefit of Docker is that it allows users to package an application with all of its dependencies into a standardized unit...
Read more >What is a Docker Image? Introduction and use cases
It is used to create, run and deploy applications that are isolated from the underlying hardware. A Docker container can use one machine,...
Read more >How to Use a Dockerfile to Build a Docker Image - Linode
A Dockerfile is a text file of instructions which are used to automate installation and configuration of a Docker image.
Read more >What is Docker Used For? A Docker Container Tutorial for ...
As you could see, most uses of Docker are to make life easier for devs when developing applications. But there are many other...
Read more >
Top Related Medium Post
No results found
Top Related StackOverflow Question
No results found
Troubleshoot Live Code
Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free
Top Related Reddit Thread
No results found
Top Related Hackernoon Post
No results found
Top Related Tweet
No results found
Top Related Dev.to Post
No results found
Top Related Hashnode Post
No results found

Thanks @agustisanchez - I like it. Depending on your setup, you might also copy wait-for-it.sh in as a mounted volume, such as this:
Multistage builds can be leveraged to install wait-for-it with apt-get:
If there was an official docker image for wait-for-it (i.e. wait-for-it/wait-for-it) we could potentially do: