一个简单的脚本,用于在使用 Docker-compose (或 Kubernetes、Docker 栈或其他) 的同时等待其他 Docker 映像启动
一个简单的脚本,用于在使用 Docker-compose (或 Kubernetes、Docker 栈或其他) 的同时等待其他 Docker 映像启动
一个小型命令行工具,用于在使用 Docker-compose (或 Kubernetes、Docker 栈或其他任何程序) 时等待其他 Docker 映像启动。 它允许等待:
此实用程序应用于 Docker 构建过程,并在应用程序启动之前启动。 例如,您的应用程序"MySuperApp"使用了MongoDB、Postgres 和 MySQL(哇!),您想确保启动时其他系统都可用,那么只需按照以下方式自定义您的 dockerfile:
## Use whatever base image
FROM alpine
## Add the wait script to the image
COPY --from=ghcr.io/ufoscout/docker-compose-wait:latest /wait /wait
## Otherwise you can directly download the executable from github releases. E.g.:
# ADD https://github.com/ufoscout/docker-compose-wait/releases/download/2.11.0/wait /wait
# RUN chmod +x /wait
## Add your application to the docker image
ADD MySuperApp.sh /MySuperApp.sh
## Launch the wait tool and then your application
CMD /wait && /MySuperApp.sh完成! 图像已准备好。
现在,让我们修改 Docker-compose.yml 文件:
暂无开放 Issues,或尚未同步最近议题。