Docker使用文件夹中的Dockerfile从git存储库合成构建上下文
我想在docker compose项目中使用git存储库构建一个新映像,因为我需要更改一些ARG变量 我担心Dockerfile位于git存储库的文件夹中 如何使用git存储库将文件夹指定为构建上下文 存储库: 我尝试了dockerfile属性:“FOLDER/”+dockerfile 但是存储库使用相对路径,并且找不到依赖项:Docker使用文件夹中的Dockerfile从git存储库合成构建上下文,docker,docker-compose,Docker,Docker Compose,我想在docker compose项目中使用git存储库构建一个新映像,因为我需要更改一些ARG变量 我担心Dockerfile位于git存储库的文件夹中 如何使用git存储库将文件夹指定为构建上下文 存储库: 我尝试了dockerfile属性:“FOLDER/”+dockerfile 但是存储库使用相对路径,并且找不到依赖项: ---> 6cc2006e9102 Step 7/9 : COPY templates /etc/gotpl/ ERROR: Service 'phpe' fa
---> 6cc2006e9102
Step 7/9 : COPY templates /etc/gotpl/
ERROR: Service 'phpe' failed to build: COPY failed: stat /var/lib/docker/tmp/docker-builder740707850/templates: no such file or directory
应该是这样的:myrepo.git#:myfolder
对于私有存储库:在gitignored
.env
文件中使用TOKEN
和TOKEN
使用https://${TOKEN}:@github.company.com/org/repo.git
来保护令牌。来源:正如@Dorin和@David在[stackoverflow]()和[docker compose:environment variables]()中提到的那样
---> 6cc2006e9102
Step 7/9 : COPY templates /etc/gotpl/
ERROR: Service 'phpe' failed to build: COPY failed: stat /var/lib/docker/tmp/docker-builder740707850/templates: no such file or directory
version: "2"
services:
php:
build:
context: https://github.com/wodby/drupal-php.git#:7
args:
- BASE_IMAGE_TAG=7.1
- WODBY_USER_ID=117
- WODBY_GROUP_ID=111
volumes:
- ./:/var/www/html