kroki icon indicating copy to clipboard operation
kroki copied to clipboard

WIP: Build server inside Dockerfile

Open copyrights opened this issue 1 year ago • 8 comments

resolves #1481

copyrights avatar Mar 25 '23 22:03 copyrights

:thinking: works on my machine with

podman build \
  --ulimit="nofile=65535:65535" \
  --runtime runc \
  -f ops/docker/jdk11-jammy/Dockerfile \
  --build-context nomnoml="./nomnoml" \
  --build-context vega="./vega" \
  --build-context dbml="./dbml" \
  --build-context wavedrom="./wavedrom" \
  --build-context bytefield="./bytefield" \
  --build-context kroki-src="." \
  server

copyrights avatar Mar 25 '23 22:03 copyrights

Tests related to sockets are failing in the container. Not sure exactly why but it says:

java.net.SocketException: Protocol family unavailable

Might be related to IPv6 not working as excepted with Docker m. Someone suggested to add -Djava.net.preferIPv4Stack=true -Djava.net.preferIPv4Addresses=true option to the JVM.

You can probably try to add these options on the surefire plugin using: https://maven.apache.org/surefire/maven-surefire-plugin/test-mojo.html#argLine

ggrossetie avatar Mar 25 '23 23:03 ggrossetie

But the test ask for IPv6

https://github.com/copyrights/kroki/blob/16aff966b0d82de953bb4609f390757cd4bd6f27/server/src/test/java/io/kroki/server/ServerListenTest.java#L69

copyrights avatar Mar 26 '23 12:03 copyrights

Ok I just did the test locally with docker buildx bake kroki and it fails at the IPv6 test as well. Then I changed my /etc/docker/daemon.json to

{
  "ipv6": true,
  "fixed-cidr-v6": "2001:db8:1::/64"
}

and systemctl restart docker. Now the build works fine. Maybe related to actions/runner-images/issues/668

copyrights avatar Mar 28 '23 19:03 copyrights

with buildah IPv6 would work https://github.com/copyrights/kroki/actions/runs/4547648299/jobs/8017796575#step:4:554

copyrights avatar Mar 28 '23 21:03 copyrights

@copyrights are you still working on it? since we made quite a few changes you will need to rebase on the main branch.

ggrossetie avatar Aug 20 '23 08:08 ggrossetie

It seems the issue in github actions is closed. But I'll have to rebase to test it. I'll give it a shot.

copyrights avatar Aug 20 '23 13:08 copyrights

Nope, still no IPv6 support inside the github action. Otherwise the rebased version builds fine on systems with IPv6 enabled.

copyrights avatar Aug 20 '23 14:08 copyrights