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

add dockerfile #2798

Closed
wants to merge 2 commits into from
Closed

add dockerfile #2798

wants to merge 2 commits into from

Conversation

LuckyTurtleDev
Copy link

This pr add a dockerfile for the sync service. So it can easy self hosted.

It can be build by executing docker build --build-arg version=23.10 . .

I would recommend to build an publish it automatic on ghcr.io at release, by using the ci. Sadly I have no appearance with buildkite.

@dae
Copy link
Member

dae commented Nov 3, 2023

Sorry, I don't have the bandwidth to deal with ghcr at this time. If you'd like this included, please make some changes:

  • move docs/docker/* into docs/docker/anki
  • move your file into docs/docker/syncserver
  • add yourself as a maintainer so people reach out to you if it breaks
  • add a small readme in that folder telling people how to use it
  • ensure CI checks pass

@LuckyTurtleDev
Copy link
Author

Sadly I can only maintain ghcr with github actions. For buildkit I have on test system and no experience.

@LuckyTurtleDev
Copy link
Author

For now I had setup an mirror of this repo LuckyTurtleDev/anki-server-docker and build an and publish the image there for every new tag matching [0-9]+.[0-9]+.
see https://github.com/LuckyTurtleDev/anki-server-docker/blob/main/.github/workflows/docker.yml

@dae
Copy link
Member

dae commented Nov 8, 2023

I'm not suggesting you publish images via CI, I'm just asking you to ensure the existing CI tests pass (i.e. you add yourself to the contributors file), and that you provide contact details in the dockerfile/readme so that if people encounter problems with it, they contact you instead of me.

@Tooa
Copy link

Tooa commented Nov 12, 2023

I stumbled upon this MR while searching for a containerized anki-sync-server for my Raspberry Pi. Find attached a slighly modified variant for cross-compiling the sync-server:

https://gist.github.com/Tooa/ca788bdb885ae2dcc5f2b0bebd6e57ed

Creating a Docker image for arm64 is as simple as replacing the Docker image tag and cross compile target according to the rust cross documentation.

Maybe someone will find this useful. Hope you guys don't mind hijacking this MR. Have a nice evening!

@LuckyTurtleDev
Copy link
Author

Creating a Docker image for arm64 is as simple as replacing the Docker image tag

No idea how this should work. You must use some kind of if function to select the right docker version.

From --platform=$BUILDPLATFORM ghcr.io/rust-cross/rust-musl-cross:$(
if   [ "$TARGETPLATFORM" == "linux/amd64"  ]; then echo "x86_64-unknown-linux-musl" \
    elif [ "$TARGETPLATFORM" == "linux/arm64"  ]; then echo "aarch64-unknown-linux-musl" \
    elif [ "$TARGETPLATFORM" == "linux/arm/v7" ]; then echo "armv7-unknown-linux-musleabihf" \
    else echo "Unknown architecture $TARGETPLATFORM"; exit 1; \
    fi )

@LuckyTurtleDev
Copy link
Author

I'm not suggesting you publish images via CI,

I think a dockerfile at some place folder in the git would not be very helpful. As long it is not build and publish to some docker registry.

@dae
Copy link
Member

dae commented Nov 15, 2023

Fair enough. I'm afraid I am not interested in integrating Docker publishing into the CI pipeline at this time, so if you don't wish to add this to the docs, there is nothing more to do on this end.

@dae dae closed this Nov 15, 2023
@LuckyTurtleDev
Copy link
Author

LuckyTurtleDev commented Nov 15, 2023

I have create an image with auto update and build/publish now: https://github.com/LuckyTurtleDev/docker-images/tree/main/dockerfiles/anki

The readme is currently missing. But will be add later.

@LuckyTurtleDev
Copy link
Author

@LuckyTurtleDev
Copy link
Author

@Tooa I have add multiplatform build. It is currently available under https://github.com/LuckyTurtleDev/docker-images/pkgs/container/test-anki for testing. If it works I will merge the changes to main.

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.

3 participants