Skip to content

docker: build and push image for master and tags - #301

Closed
khos2ow wants to merge 2 commits into
tailscale:mainfrom
khos2ow:push-docker
Closed

khos2ow wants to merge 2 commits into
tailscale:mainfrom
khos2ow:push-docker

Conversation

@khos2ow

@khos2ow khos2ow commented Apr 15, 2020 •

Copy link
Copy Markdown

This is to push docker images to https://hub.docker.com/r/tailscale/tailscale when:

Ref Name Build Push
master edge yes yes
tags - name without v
- latest
yes yes
branches Commit SHA yes no

Note to reviewers:

  1. I'm dropping leading v from tag name when pushing the image, let me know if you want me to revert that.
  2. I created a dedicated Docker workflow for PRs which only builds the docker image, this might be a bit redundant but my thought was that to catch fast any potential building failure of images on the PR when binaries for the same PR were built successfully.
  3. Two secret variables need to be set: REGISTRY_USERNAME and REGISTRY_PASSWORD

Fixes #295


This change is Reviewable

┆Issue is synchronized with this Asana task by Unito

@khos2ow

khos2ow commented Apr 21, 2020

Copy link
Copy Markdown
Author

ping @bradfitz @danderson

@bradfitz
bradfitz requested a review from danderson April 28, 2020 02:58
@bradfitz

Copy link
Copy Markdown
Member

I think @danderson is better qualified to review this one.

@danderson

Copy link
Copy Markdown
Member

This is generally good, however a couple of things are going to make me decline this PR:

  • This really needs to live in our non-OSS CI, which is where the rest of releases gets built. Due to weirdness in our repo structure, that's the only way to burn correct version numbers into the binary at this time.
  • Pushing Docker images signals that we support running Tailscale in a Docker image. However, early adopters who've tried have discovered a lot of ways in which this falls apart (most recently: broken iptables interactions between host and container), because we currently do not support this and haven't done the legwork to debug running as a container. I would prefer to order things the other way around: make our docker image more robust, then start pushing it automatically.

@bradfitz thoughts on the above?

@bradfitz

Copy link
Copy Markdown
Member

I agree on the second bullet completely.

I'm less convinced that this needs to be closed long-term, though. The version number weirdness we could solve somehow. But maybe we'll have a plan for that by the time we support Docker/Kubernetes well.

@khos2ow

khos2ow commented May 26, 2020

Copy link
Copy Markdown
Author

Those are good points, and I wasn't aware of the issues on containerized version.

And quite frankly doing release automation can vary for each project/team and I wasn't sure how heavily the other closed CI system is being used.

Regardless I'm open to give a hand on both if need be, let me know.

@jzelinskie

Copy link
Copy Markdown
Contributor

If you want to avoid the perception of supported container images, but still have builds available, why not create a tailscale/tailscale-git repository and build every commit? Because nothing would be tagged as a release, it'd be clearer that they are developer builds and you'd get a form of "CI" that tests the Dockerfile for every commit.

This is what I've done in the past, then I only curate and promote releases to the canonical container repository (e.g. tailscale/tailscale).


- name: Set version output
id: vars
run: echo ::set-output name=tag::${GITHUB_REF:11} # tag name without leading 'v'

@aaron-trout aaron-trout Jun 10, 2020 •

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Out of interest why drop the v from the version on the Docker tag, but not the git tag? I don't have any preferences on using the v prefix or not, but I would think the reasoning would be the same whether this is a git tag or a container image tag (i.e. keep consistency across both)?

Thanks,
Your random unsolicited reviewer of the day :-)

Copy link
Copy Markdown
Author

Choose a reason for hiding this comment

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

The reason I dropped v from Docker tag was because anything after : is considered some sort of a version and notion of v in that was kind of redundant. There are so many cases of both sides out there, two very notable ones:

  • Grafana tags with leading v BUT images without.
  • Prometheus tags with leading v AND images also with.

At the end, this was a personal preference. And to be clear I'm not affiliated with Tailscale and this PR is only a personal contribution.

@apenwarr
apenwarr changed the base branch from master to main June 15, 2020 18:26
@bradfitz

Copy link
Copy Markdown
Member

This is on hold for #504. We want to make our Dockerfile a bit more usable before we start getting too many bug reports about it.

Also, we'd want to do this in our corp meta repo probably.

I'm going to close this for now but we'll revisit it soonish I hope.

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

Successfully merging this pull request may close these issues.

Publish Dockerfile to enable docker pull tailscale

5 participants