Concourse无法构建并部署到docker,我收到此错误:
无效参数“http://10.250.249.243:5000/frontend-srv-img:latest” for t:解析引用时出错: “http://10.250.249.243:5000/frontend-srv-img:latest”无效 repository / tag请参阅'docker build --help'。
我正在尝试在任务中构建一个前端源代码,导致dist:frontend-dist。
然后我想在“put”中使用这个dist到我的本地docker注册表,所以我提供了“put”与dist文件夹和docker文件路径。注意:dist和docker文件来自不同的repos / branches。
---
#Git repo containing docker-template and build scripts:
resources:
- name: devops-repo
type: git
source:
uri: git@bitbucket.org:myorg/client-devops.git
branch: dev
private_key: {{private-key}}
#Git repo containing docker-template and build scripts:
- name: client-repo
type: git
source:
uri: git@bitbucket.org:myorg/client-devops.git
branch: frontend
private_key: {{private-key}}
#Docker-image containing the built source:
- name: frontend-server-image
type: docker-image
source:
repository: http://10.250.249.243:5000/frontend-srv-img
insecure_registries: ["http://10.250.249.243:5000"]
jobs:
- name: job-frontend
public: true
plan:
- aggregate:
- get: devops-repo
trigger: true
- get: client-repo
trigger: true
- task: Build frontend using grunt
file: devops-repo/build-frontend.yml
- put: frontend-server-image
params:
build: frontend-dist
dockerfile: devops-repo/frontend-server/Dockerfile
集结frontend.yml
---
platform: linux
image_resource:
type: docker-image
source:
repository: node
tag: 'latest'
inputs:
- name: client-repo
outputs:
- name: frontend-dist
run:
path: sh
args:
- -exc
- |
ls -lah
cd client-repo
# npm install -g grunt-cli
# npm install -q
# grunt pipeline
mkdir dist
touch dist/test123
mv -f dist ../frontend-dist
cd ..
ls -lah
答案 0 :(得分:1)
我认为您的问题是您指定的存储库 - 请勿包含http://
前缀:
- name: frontend-server-image
type: docker-image
source:
repository: 10.250.249.243:5000/frontend-srv-img
insecure_registries: ["http://10.250.249.243:5000"]
类似的事情对我有用(但我们有SSL证书,因此不需要指定insecure_registries选项。)