0

Concourse cant build and deploy to docker, I get this error:

invalid argument "http://10.250.249.243:5000/frontend-srv-img:latest" for t: Error parsing reference: "http://10.250.249.243:5000/frontend-srv-img:latest" is not a valid repository/tag See 'docker build --help'.

I am trying to build a frontend source-repo in a task, resulting in a dist: frontend-dist.

Then I want to use this dist in the "put" to my local docker registry, so i provide the "put" with the dist folder and the docker file path. Note: the dist and docker file come from different 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

build-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
David Karlsson
  • 9,396
  • 9
  • 58
  • 103
  • Can you `fly intercept` to the container doing the `put`, and try running it manually? Looks to my naïve eyes to be a Docker problem rather than a Concourse one. – DeejUK Nov 11 '16 at 09:38
  • Is it the worker doing the put? – David Karlsson Nov 11 '16 at 09:50
  • 1
    It is, but if you use a combination of `fly containers` and `fly intercept` you will be able to establish an SSH session into the container itself (not just the host worker VM) that is doing the `put`. That way you can see the state of the container, and poke around to debug further. – DeejUK Nov 11 '16 at 09:52
  • Jump on slack.concourse.ci to chat further, if you like – DeejUK Nov 11 '16 at 09:53
  • 1
    you don't need the `http://` in front of your private registry. just add it as `repository: 10.250.249.243:5000/frontend-srv-img` `insecure_registries: ["10.250.249.243:5000"]` – GHETTO.CHiLD Feb 13 '17 at 13:11

1 Answers1

1

I think your problem is the repository you have specified -- don't include the http:// prefix:

- 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"]

A similar thing is working for me (but we have an SSL cert, so don't need to specify the insecure_registries option.)

Ash Berlin-Taylor
  • 3,879
  • 29
  • 34