Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

How to use with Declarative Pipeline and docker agent #20

Open
sheerun opened this issue Dec 10, 2017 · 7 comments
Open

How to use with Declarative Pipeline and docker agent #20

sheerun opened this issue Dec 10, 2017 · 7 comments
Assignees

Comments

@sheerun
Copy link

sheerun commented Dec 10, 2017

Hello,

I'm trying to make my declarative pipeline run on azure container instances without employing something like docker in docker. Is there a way to enable something so Jenkinsfile like this could work out of the box on Azure Container Instances?

pipeline {
    agent {
        docker { image 'node:7-alpine' }
    }
    stages {
        stage('Test') {
            steps {
                sh 'node --version'
            }
        }
    }
}

Here's documentation: https://jenkins.io/doc/book/pipeline/docker/

EDIT: Actually it seems docker in docker doesn't even work on Container Instances

@zackliu
Copy link
Contributor

zackliu commented Dec 11, 2017

Docker in docker isn't supported in ACI but supported in ACS

@zackliu
Copy link
Contributor

zackliu commented Jan 25, 2018

Hi, what your purpose to use Docker inside a container. If you need some specific environment, you can just prepare such a Docker image with JNLP or SSH and use it as agent directly.

@sheerun sheerun changed the title How to use with Declarative Pipeline and docker without dind How to use with Declarative Pipeline and docker agent Jan 25, 2018
@sheerun
Copy link
Author

sheerun commented Jan 25, 2018

I don't need docker inside container (well, I'd like to have it for building images and testing images along services, but that's other matter). The only reason I mentioned dind is that I thought it could workaround my issue by running docker commands inside steps, instead of configuring proper image as agent.

This issue is only about ability to run declarative pipeline that I've mentioned, on ACI runtime.

I've modified the title of issue to better reflect it.

@zackliu
Copy link
Contributor

zackliu commented Jan 25, 2018

Sorry, I need to make the issue more clearly. What you want to achieve is if you use the Jenkinsfile above, actually Jenkins will provision an azure container instance with nodejs image to run the following commands. Is my understanding correct?

@sheerun
Copy link
Author

sheerun commented Jan 25, 2018

That's correct :) The point is to be able to run above pipeline unmodified on both ACI and ACS.

@mitchellmaler
Copy link

I am also wondering the same thing.

Using Jenkins declarative pipeline can you use the specified ACI cloud but in the pipeline/jenkinsfile specify the image to deploy and use for the job.

This way we don't have to manually specify the templates but it can be done in the jobs jenkinsfile.

@nerumo
Copy link

nerumo commented Mar 22, 2018

@zackliu you said it works in acs. So if a build requests a part to run in a specific docker image (without jnlp) it should provision a container and run stuff in there?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants