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

What is an image parameter? #2

Open
lukyanov opened this issue Mar 5, 2020 · 5 comments
Open

What is an image parameter? #2

lukyanov opened this issue Mar 5, 2020 · 5 comments

Comments

@lukyanov
Copy link

lukyanov commented Mar 5, 2020

Hello!

What should I specify as an image here:
https://github.com/leopardslab/dunner-gocd-plugin/blob/master/docs/images/create_dunner_task.png

If I use gocd agents as docker containers, should I specify the gocd agent image there? That sounds strange as the Dunner task will run inside a gocd agent anyway.

If I use gocd agents as machines, why specify a docker image at all?

Could you suggest?

@apoorvam
Copy link
Collaborator

apoorvam commented Mar 5, 2020

@lukyanov You should specify the name of the docker image that you want to use to run the tasks. For example if I want to run a golang application in the container(on go agent machine), I will specify image as "golang:latest".

This pulls the golang image so I have necessary environment to run my application. You can similarly use any of nodejs, java or plain vanilla linux docker images.

@lukyanov
Copy link
Author

lukyanov commented Mar 5, 2020

Ok, but Dunner config also specifies images to run your commands against, right? How those two types of images relate to each other?
So, there is "golang:latest". Then Dunner starts other containers inside the first one to run its commands, right? What is the point here?

I never used Dunner before, so forgive me my probably stupid questions :)

@apoorvam
Copy link
Collaborator

apoorvam commented Mar 5, 2020

Its only one image thats specified. For a dunner task, the "image" is the image thats pulled and all the commands are run in that image.
If you want another image, you can create another dunner task with gocd plugin and then list down the commands there.

In each dunner task, you can specify a image and a bunch of commands to be run against it.

Alternately, Dunner is available as a command-line tool too. You can refer the documentation here: https://dunner.io/docs/introduction-to-dunner or see this basic usage screencast.

This lets you define the commands with the image in which it should run and lets you organize it. You can check-in the config file that it creates i.e .dunner.yaml file to git and then run dunner do <taskname> from GoCD config. This spins up a docker container in the go agent machine and runs the commands inside it.

@lukyanov
Copy link
Author

lukyanov commented Mar 6, 2020

Sorry for my stupid questions, but I still have some :)

I understand that the Dunner is running the commands inside a docker container. That's why it has "image" as an argument in its configuration (yaml file).

What I don't understand is why the dunner-gocd-plugin also wants me to specify a docker image in GoCD settings. What that image is for?

@apoorvam
Copy link
Collaborator

apoorvam commented Mar 6, 2020

Ah I see your confusion now. If you defined your dunner task already in a file .dunner.yaml, you dont have to use the dunner task in gocd plugin. This plugin helps you define the dunner task(instead of doing it in file) by specifying the image name and commands to be run inside it.

If you have tasks defined already in the file you can just run a simple command in gocd, say dunner do <taskname>. You dont have to use the gocd plugin for it. This plugin is written for users who do not want to define configs in the file, maybe temporary tasks or for newcomers to dunner.

The dunner-gocd-plugin is simulating the behaviour of using dunner from commandline. Internally it also creates a dunner task file and executes it using dunner cli. For new users, this can generate a dunner task file.

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

2 participants