{"repo":"ufoscout/docker-compose-wait","free":true,"listed":false,"github":"https://github.com/ufoscout/docker-compose-wait","clone":"git clone https://github.com/ufoscout/docker-compose-wait.git","description":"A simple script to wait for other docker images to be started while using docker-compose (or Kubernetes or docker stack or whatever)","language":"Rust","stars":1708,"topics":["docker","docker-images","dockerfile","kubernetes","sleep","synchronization","wait","containers"],"license":"Apache-2.0","category":"deployment-docker-iac","readme_excerpt":"docker-compose-wait A small command-line utility to wait for other docker images to be started while using docker-compose (or Kubernetes or docker stack or whatever). It permits waiting for: - a fixed amount of seconds - until a TCP port is open on a target image - until a file or directory is present on the local filesystem Usage This utility should be used in the docker build process and launched before your application starts. For example, your application \"MySuperApp\" uses MongoDB, Postgres and MySql (wow!) and you want to be sure that, when it starts, all other systems are available, then simply customize your dockerfile this way: Done! the image is ready. Now let's modify the docker-compose.yml file: When docker-compose is started (or Kubernetes or docker stack or whatever), your application will be started only when all the pairs host:port in the WAIT HOSTS variable are available. The WAIT HOSTS environment variable is not mandatory, if not declared, the script executes without waiting. If you want to use the script directly in docker-compose.yml instead of the Dockerfile, please note that the command: configuration option is limited to a single command so you should wrap in a sh call. For example: This is discussed further here and here. Usage in images that do not have a shell When using distroless or building images FROM scratch , it is common to not have sh available. In this case, it is necessary to specify the command for wait to run explicitly. The invoked comma","default_branch":null,"files":null,"tree":[],"storefront":"/r/ufoscout","claimed":false,"request_supported":{"post":"https://gitbuyer.com/r/ufoscout/docker-compose-wait/request-supported","requests":0},"note":"indexed from public GitHub; nothing is for sale on this page. Clone it from GitHub. Paid listings live at /search."}