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

Added docs for detach #309

Closed
wants to merge 3 commits into from
Closed

Added docs for detach #309

wants to merge 3 commits into from

Conversation

clayrisser
Copy link

@jmccann
Copy link

jmccann commented Jan 31, 2018

I think this may be a dupe of #301

image: example/image:latest
detach: true

test: # runs parallel to example_image
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I feel like for documenting detached, we should use a simpler example, such as starting a mysql server in detached mode. Right now it introduces multiple concepts (detached mode and building and testing docker image) instead of focusing on the single topic of detached mode.

With that being said, I feel like there is a ton of value in having documentation for building, detaching and then testing a container. @tonglil perhaps we could benefit from a subsection of the docs that focuses solely on building, testing and publishing docker containers, since there are a few different methods. Thoughts?

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

EDIT: we had this documented in a prior version of the docs, but must have slipped through the cracks when we moved documentation sites. See below.

Service containers can also be included in the pipeline section of the Yaml using the detach parameter. This should be used when explicit control over startup order is required.

pipeline:
  build:
    image: golang
    commands:
      - go get
      - go build

  database:
    image: redis
+   detach: true

  test:
    image: golang
    commands:
      - go test

@clayrisser
Copy link
Author

Where would you want me to document how to build, detach, and test a container? Btw, FYI, the docker plugin does not support a build separate from a push very well.

@bradrydzewski
Copy link
Member

bradrydzewski commented Jan 31, 2018

Where would you want me to document how to build, detach, and test a container

For now I would recommend adding to the FAQ section of the documentation. We can find a more permanent home for the documentation once we do some restructuring.
https://github.com/drone/docs/tree/master/content/faq

Btw, FYI, the docker plugin does not support a build separate from a push very well.

The docker plugin exists so that you can build and publish images safely using docker in docker, without having to insecurely expose the host machine docker socket. Using the plugin to build an image on the host machine is not a problem this plugin tries to solve. You are probably better off just doing something like this:

pipeline:
  build:
    image: docker
    commands: [ docker build -t foo . ]
    volumes: [ /var/run/docker.sock:/var/run/docker.sock ]

Note that we try to design plugins to do one thing, and do it well. So if a plugin does not handle your specific use case, you might want to consider creating your own custom plugin. Having many specialized plugins is encouraged, as opposed to having monolith plugins that do everything.

@clayrisser
Copy link
Author

Ok, cool, I'll prob make a plugin for handling the individual docker pipeline steps.

@tonglil tonglil mentioned this pull request Apr 10, 2018
@tonglil tonglil closed this in #301 Apr 10, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
3 participants