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

Automatically push to dockerhub as part of CI pipeline #66

Closed
jesseduffield opened this issue Jul 2, 2019 · 13 comments
Closed

Automatically push to dockerhub as part of CI pipeline #66

jesseduffield opened this issue Jul 2, 2019 · 13 comments
Labels
enhancement New feature or request

Comments

@jesseduffield
Copy link
Owner

Is your feature request related to a problem? Please describe.
It would be cool if we built the lazydocker image and pushed to docker hub as part of the CI pipeline when we do a release

@glvr182
Copy link

glvr182 commented Jul 2, 2019

You can setup Autobuild on dockerhub aswell. See this

@dawidd6
Copy link
Collaborator

dawidd6 commented Jul 2, 2019

Yes, can confirm that @glvr182 . It's really straightforward. Just Github login is required.
https://hub.docker.com

@qdm12
Copy link
Contributor

qdm12 commented Jul 2, 2019

Hey @jesseduffield what's your Docker Hub username? For readme badges purposes

You can setup autobuilds here and then you can get a webhook link for nice badges of the Docker image size and version at https://microbadger.com/images/jesseduffield/lazydocker

I already added a build hook for Docker Hub's automated build as well as a few Docker Hub markdown badges on the reworking-dockerfile branch.

@qdm12
Copy link
Contributor

qdm12 commented Jul 2, 2019

You may want to use Circle CI to build the Docker image and push it to Docker Hub as well. This is great as everything takes place in the same place and it will fail if there is an integration bug.

However, I think that an automated build with Docker Hub is more trustworthy as it's hard for the user to find the origin of the Docker push (which should be Circle CI) to Docker Hub (a.k.a. malicious Docker images not corresponding to Github's repository source code)

@jesseduffield
Copy link
Owner Author

@qdm12 not sure if you saw my comment in your PR but we can use the dockerhub username of 'lazyteam' and the repo of 'lazydocker'.

What are your thoughts on us using goreleaser to handle building and pushing the image? We currently use it for building the binaries, homebrew, and snapcraft. And it has support for docker as well: https://goreleaser.com/docker/

@qdm12
Copy link
Contributor

qdm12 commented Jul 5, 2019

As you wish, the only thing is that any other party than Docker Hub would have to docker push from outside so it's not great security wise for careful users (although probably not many!).

For example, Linuxserver push all their images from their CI but I'm not sure the user can actually verify this. So it could be a malicious/corrupted image they pushed manually from their desktop for example.

On my side, I always have automated Docker Hub builds linked to Github for x86_64. I however push ARM images from an ARM device I have as there is no CI/Docker Hub solution to build efficiently for ARM devices...

@jesseduffield
Copy link
Owner Author

from your experience is it simple enough to hook everything up with the docker hub approach @qdm12 ?

@qdm12
Copy link
Contributor

qdm12 commented Jul 5, 2019

Yes, it's 15 key strokes and 5 mouse clicks, here 😸
Plus you can add a bit of CI-like features to the Docker Hub build using files in the hooks directory if you want to.

But you should have both a CI and Docker Hub, which builds all Docker images only.

@jesseduffield
Copy link
Owner Author

How does this look to you?
image
Also I'm guessing we wouldn't want to actually set this up until your PR is merged, correct?

@qdm12
Copy link
Contributor

qdm12 commented Jul 5, 2019

  • You could add a latest docker tag build from the master branch of the latest Github tag. By default Docker will pull the latest tag if not tag is specified, i.e. docker run -it lazyteam/lazydocker so it's a good idea to have a latest tag 👍
  • I was not aware of that new AUTOTEST feature that could be of interest!

You can set this up now by just clicking Save and it will get triggered on the next push or maybe next tag creation.

@jesseduffield
Copy link
Owner Author

done :)
image

@qdm12
Copy link
Contributor

qdm12 commented Jul 5, 2019

Cool! It will pickup the new Dockerfile and build hooks when we merge the docker PR.

I guess we can close the issue now.

@jesseduffield
Copy link
Owner Author

sounds good

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

No branches or pull requests

4 participants