Warning: file_get_contents(/data/phpspider/zhask/data//catemap/7/sqlite/3.json): failed to open stream: No such file or directory in /data/phpspider/zhask/libs/function.php on line 167

Warning: Invalid argument supplied for foreach() in /data/phpspider/zhask/libs/tag.function.php on line 1116

Notice: Undefined index: in /data/phpspider/zhask/libs/function.php on line 180

Warning: array_chunk() expects parameter 1 to be array, null given in /data/phpspider/zhask/libs/function.php on line 181
如何在使用git时构建docker compose映像?_Git_Docker_Docker Compose - Fatal编程技术网

如何在使用git时构建docker compose映像?

如何在使用git时构建docker compose映像?,git,docker,docker-compose,Git,Docker,Docker Compose,我希望升级我的应用程序,使其与docker compose一起运行,而不是与docker一起使用systemd单位文件。但是,我的web应用程序使用git,因此我的服务器上没有.yml文件。每次我尝试构建docker compose映像时,服务器上都找不到我的.yml文件。它返回: ERROR: Can't find a suitable configuration file in this directory or any parent. Are you in the righ

我希望升级我的应用程序,使其与docker compose一起运行,而不是与docker一起使用systemd单位文件。但是,我的web应用程序使用git,因此我的服务器上没有
.yml
文件。每次我尝试构建docker compose映像时,服务器上都找不到我的
.yml
文件。它返回:

ERROR:
    Can't find a suitable configuration file in this directory or any
    parent. Are you in the right directory?

    Supported filenames: docker-compose.yml, docker-compose.yaml

如何在使用git remote repo时构建docker compose映像?

您需要在服务器上生成一个
docker compose.yml
文件(或从外部引用复制)

这可以通过确保每次推送新提交时:

  • docker compose.yml仍然存在
  • 如果没有,请复制/生成它