autopilotpattern / jenkins

Extension of official Jenkins Docker image that supports Joyent's Triton for elastic slave provisioning
43 stars 10 forks source link

sdc-docker builds on CLI but not in Jenkins job #13

Closed charandas closed 7 years ago

charandas commented 7 years ago

I am using Jenkins on Triton using this repo. But I am really new to sdc-docker and its not building for me within the context of a Jenkins job. More details below:

I am using my private registry with a docker-compose.yml like so:

version: "3.0"
services:
  lib:
    build: "./"
    image: "gitlab.fathm.io:4657/lib/schema-survey-data"
    depends_on:
      - rethink
  rethink:
    image: "gitlab.fathm.io:4657/dockerfiles/rethinkdb:2.3.5"
Step 1 : FROM gitlab.fathm.io:4657/dockerfiles/node:6.9.3
 ---> fcad3edd2866
Step 2 : MAINTAINER charandas@fathm.io
 ---> Using cache
 ---> 8bb9f7f7fd65
Step 3 : COPY .npmrc /src/
 ---> Using cache
 ---> 4f15faff6e77
Step 4 : COPY package.json /src/
 ---> Using cache
 ---> 55b9303693eb
Step 5 : RUN cd /src                         &&     echo "# REPLACE ME" > README.md &&  npm install &&  npm cache clean
 ---> Using cache
 ---> ac9b3ba3ffe0
Step 6 : COPY . /src
Service 'lib' failed to build: Error: image ac9b3ba3ffe0ca43e197dd3439125dce5b70fb2633c14b2fe420a4b8154687bb:latest not found (62b5c066-f633-4a6f-9547-ae00beb44cff)

The message above doesn't make much sense to me at all. When I login into the CLI: I can use sdc-docker successfully.

... stuff omitted ...
 ---> ac9b3ba3ffe0
Step 6 : COPY . /src
 ---> cf1dbcaa4619
Step 7 : CMD /usr/bin/npm test
 ---> b94d29af8629
Importing image 8bb9f7f7fd65 into IMGAPI
Importing image 4f15faff6e77 into IMGAPI
Importing image 55b9303693eb into IMGAPI
Importing image ac9b3ba3ffe0 into IMGAPI
Importing image cf1dbcaa4619 into IMGAPI
Importing image b94d29af8629 into IMGAPI
Successfully built b94d29af8629

I am curious as to why the difference between Jenkins and CLI run.

charandas commented 7 years ago

This is with local-compose.yml, which I am pretty sure is spawning job containers in Triton.

I am also not sure why I am having rogue containers leftover from the build (named like build_62b5c066-f633-4a6f-9547-ae00beb44cff), curious as to what might be going wrong with garbage collection?

misterbisson commented 7 years ago

@charandas the error you're getting from sdc-docker is not uncommon:

Error: image ac9b3ba3ffe0ca43e197dd3439125dce5b70fb2633c14b2fe420a4b8154687bb:latest not found (62b5c066-f633-4a6f-9547-ae00beb44cff)

We designed Docker support on Triton to provide the best place to run Docker containers, and that remains our priority with sdc-docker.

Our recommended solution is to build Docker images using Docker Inc's Docker daemon on KVM instances. We'll have a clear blueprint for that soon.

charandas commented 7 years ago

Thanks @misterbisson.

Per @tgross 's comment here, I am trying to build and deploy a test container in Triton.

I am not fully aware of the docker setup at the end of provisioning the Jenkins container, but I will look further into this today. It looks like I wanna build against local docker daemon and deploy with Triton.

Jenkins configuration does show the Triton DC's under docker plugin. I wonder if there is the local daemon under it, or if Jenkins allows me to reference a selected profile for any docker command.

charandas commented 7 years ago

Closing in light of the new PR by @tgross.

misterbisson commented 7 years ago

@charandas Since you're focused on Triton, I should tell you that the Joyent support team will be able to give you much more targeted advice.

However, to try to point you in a useful direction, especially if your intentions are simply to get any test container running on Triton, I should also point out the following:

charandas commented 7 years ago

Thank you. Actually, @misterbisson I wanted to ask if native macOS docker is discouraged, and docker-machine preferred over it. If so, why is that?