Skip to content

Conversation

@Migelo
Copy link
Contributor

@Migelo Migelo commented Mar 21, 2023

Purpose

As discussed in #8691 I started updating the build system to automatically build syncthing and related programs and publish them to dockerhub.

Testing

I used the working gh actions from my docker-syncthing-relay repo.
You can also check my fork and the finished action where all arches successfully finished building here.

Or the latest one where I only build for amd64 so we can iterate more quickly on this PR.

Todo

  1. How to implement automatic tagging of docker images with the correct version. The commented out portion of my changes are how I deal with automatic versioning by setting it manually in Dockerfile and then greping it from there and into gh actions.
  2. The repo owner has to add their DOCKERHUB_USERNAME and DOCKERHUB_TOKEN under Settings->Security->Secrets and variables->Actions

@imsodin
Copy link
Member

imsodin commented Mar 21, 2023

Isn't docker hub killing the free tier, or was that a storm in a teacup? If it isn't, maybe that's a good reason to move to e.g. ghcr while adding this anyway. I guess @calmh you own the docker syncthing org - did you get any news on that?

@Migelo
Copy link
Contributor Author

Migelo commented Mar 21, 2023

From my understanding syncthing aren't offering a paid version of their software neither do they offer paid support so it should be ok?
In any case, I'm happy to update this PR to include a push to gh registry.

@imsodin
Copy link
Member

imsodin commented Mar 21, 2023

In any case, I'm happy to update this PR to include a push to gh registry.

I should have made this clearer before, sorry: Please don't change anything in this PR (yet).

From my understanding syncthing aren't offering a paid version of their software neither do they offer paid support so it should be ok?

My understanding is that doesn't matter, everyone gets to pay. Resp. there's a track for open source software, but apparently it's cumbersome/slow. Referring to stuff like this:
https://news.ycombinator.com/item?id=35154025
docker/hub-feedback#2314
Then again I don't have first hand knowledge and can't easily find anything definitive. So maybe there's no issue at all, just wanted to check whether @calmh is already aware of issues, resp. got such an email from docker about cost/cancellation.

@calmh
Copy link
Member

calmh commented Mar 24, 2023

It's on my radar to sort out and apply for the open source thing, though the form was annoying and I got side tracked.

@Migelo
Copy link
Contributor Author

Migelo commented Mar 24, 2023

You don't have to worry about it anymore. They walked back the whole thing: https://www.docker.com/blog/no-longer-sunsetting-the-free-team-plan/

@Migelo
Copy link
Contributor Author

Migelo commented Apr 27, 2023

If there is still interest in merging this, I am happy to work on it.

@calmh
Copy link
Member

calmh commented Apr 28, 2023

There is, it just needs some tweaks to how Syncthing is built. Currently there's a Dockerfile.buildx that we use for the multi arch builds, which expects binaries to already be present. We compile the binaries prior to the docker step:

for arch in amd64 arm arm64 ; do
	go run build.go -goos linux -goarch $arch -no-upgrade build syncthing
	mv syncthing syncthing-linux-$arch
done

@Migelo
Copy link
Contributor Author

Migelo commented May 3, 2023

I am not sure what I should do here, could you please give me some pointers please? All the checks seem to pass so idk where to start.

@Migelo
Copy link
Contributor Author

Migelo commented May 3, 2023

Aha, I see

COPY ./syncthing-linux-$TARGETARCH /bin/syncthing

this file has to be present and is what you were referring to, right?

calmh added a commit that referenced this pull request Jun 14, 2023
This builds and publishes our Docker images from GitHub.
calmh added a commit to calmh/syncthing that referenced this pull request Jun 14, 2023
* main:
  build: Update some dependencies
  build: Make sure we get the latest matching Go version
  build: Multi arch Docker images with GitHub actions (ref syncthing#8834)
  lib/config, gui: Disallow some options in combination with "untrusted" (fixes syncthing#8920) (syncthing#8921)
  gui, man, authors: Update docs, translations, and contributors
  Don't add empty device to config on init (syncthing#8933)
  build: Push release files to cloud storage
  build: Generate .asc files for release packages (fixes syncthing#8897)
  build: Properly build all Debian archs (fixes syncthing#8898)
  gui: Avoid code generating HTML (syncthing#8923)
  gui: Remove HTML support in tooltips
  gui: Avoid code generating HTML (syncthing#8923)
  build: Tests should run with Go 1.20 on Windows (syncthing#8924)
  gui, man, authors: Update docs, translations, and contributors
  lib/model: Improve test for unignored parent directories (syncthing#8926)
  build: Update dependencies (syncthing#8925)
  gui: Remove HTML support in tooltips
  cmd/syncthing: Use correct binary when restarting monitor (syncthing#8919)
@calmh calmh closed this in 4658232 Jul 1, 2023
@calmh
Copy link
Member

calmh commented Jul 1, 2023

Thanks for this @Migelo I've incorporated your changes into the build setup, and marked you as co-author of the commit in question.

calmh added a commit that referenced this pull request Jul 3, 2023
…fixes #8691, fixes #8960)

This adds builds for the discovery and relay servers in the same manner
as Syncthing, so that Docker images are kept up to date with releases.

Inspired by and closes #8834.

Co-authored-by: Migelo <miha@filetki.si>
@st-review st-review added the frozen-due-to-age Issues closed and untouched for a long time, together with being locked for discussion label Jun 30, 2024
@syncthing syncthing locked and limited conversation to collaborators Jun 30, 2024
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

frozen-due-to-age Issues closed and untouched for a long time, together with being locked for discussion

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants