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

Publish to Dockerhub #14

Open
marklindell opened this issue Jul 1, 2020 · 4 comments
Open

Publish to Dockerhub #14

marklindell opened this issue Jul 1, 2020 · 4 comments
Labels
Trustful evedence Something which enables Trust on this product

Comments

@marklindell
Copy link

Project already includes a Dockerfile so it should be published to Dockerhub as part of the action build.

@aravind666
Copy link
Contributor

We need an account there, in dockerhub, would you kindly help me getting access to Opensource dockerhub account . I can update our pipelines to publish the image there

@marklindell
Copy link
Author

Not sure what you mean by an "opensource dockerhub account". Dockerhub is free to anyone who publishes from and open source project. I have an account marklindell is my github philips identity. I would think you want one of your maintainers to hold the account that is is published under. (e.g. you) Be sure to put your creds in secrets on the project.

Also, please consider your CI design wrt to actions. Right now you have multiple actions for build and dogfood tests. By adding artifact publish to the CI you really don't want to publish to dockerhub except on merge to master after all the other tests have completed successfully. I don't believe there is a way to chain actions together in a workflow. You might need to rethink how you handle design of separate actions and move it into one actions with different dependent jobs.

For instance in one of my projects I have a step to push to nuget.org but only when it's not a PR.

  • name: push to nuget
    if: github.event_name != 'pull_request'
    run: mono $NUGET_EXE push target/hsdp-iam.${{ steps.gitversion.outputs.major }}.${{ steps.gitversion.outputs.minor }}.${{ steps.gitversion.outputs.patch }}.nupkg ${{ secrets.NUGET_APIKEY }} -Source https://api.nuget.org/v3/index.json

Also need to think about versioning strategy for the the docker image. It should align with your versioning strategy for the releases. How are you handling those?

I was thinking about submitting a PR but I feel that you would need to setup the CI so I will leave it to you. I'm glad to lend feedback where necessary.

@aravind666
Copy link
Contributor

aravind666 commented Jul 1, 2020

@marklindell , Thanks for your guidelines, I am aware of all those netty grities in the pipeline , I have a personal dockerhub account since long time, I also have my own private docker images available there I am aware of how we can publish in those github action.

Question is since this is philips open source project, how can I push the docker image to personal dockerhub repo.

If you are aware of any philips open source dockerhub repo I can freely push to that.

I am not sure weather I have a privilage to push to my personal dockerhub repository when this software is open sourced under philips .

We should take an opinion from the legal team here before we make things public .

Since I did not see that as a high priority long back I just holded myself doing it, and since all my tests and builds are running under JDK8 and maven as long as they both are installed my code works and my tests pass and my executable really well I have tests to assert the behavior.

So I have provided Dockerfile to allow any developer to build the image and spawn the container out of it. Having a Dockerfile does not necessarily mean I have to keep an image some where. If you see my Dockerfile it has nothing so special I am just setting the locale there from the JDK8 + maven image.

If you are not aware of how you can build the docker image and spawn a container out of it and then mount your local folder into it and run the application with in the container below is the command that you can use to do so.

first build the image

docker build -t cerebrus_image .

Run the container

docker run -ti -v /path/to/Project/Cerebrus:/usr/src cerebrus_image bash

I belive developers can easily do this, and my environments are not so complex to have a custom Docker image.

@marklindell
Copy link
Author

marklindell commented Jul 1, 2020

Philips has a dockerhub Organizaton. https://hub.docker.com/u/philipssoftware My dockerhub account is linked to to my github identity and it says I am part of the Philips dockerhub organization as well.

@aravind666 aravind666 added the Trustful evedence Something which enables Trust on this product label Oct 5, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Trustful evedence Something which enables Trust on this product
Projects
None yet
Development

No branches or pull requests

2 participants