rspamd / rspamd-docker

Rspamd as Docker image
9 stars 5 forks source link

documentation about the build arguments #33

Open k3ck3c opened 2 months ago

k3ck3c commented 2 months ago

Hello

I tried to build the image but found no documentation about the values the build arguments should have

I found PKG_TAG could be 3.9 or 3.9.1 from https://github.com/rspamd/rspamd/tags

but failed to guess any valid value for ASAN_TAG

so the following command failed

docker build -t --build-arg="PKG_TAG=3.9" . 

I guess I miss something very obvious

Thanks for your time

fatalbanana commented 2 months ago

It's recommended to use the already-built image (in FROM if you'd want to extend it). Forking the image on Github and rebuilding there might also be convenient.

Building the image is a 2-step process (currently for no good reason but in the future it will likely be useful again).

  1. Image used for builds (ghcr.io/rspamd/rspamd-build-docker:debian-bookworm) is here - building that is straight-forward. To use a different image, Dockerfile.pkg should be modified accordingly.
  2. Build the package image: docker build -t rspamd_pkg:3.9.1 --build-arg=RSPAMD_VERSION=3.9.1 --build-arg=RSPAMD_GIT=3.9.1 -f Dockerfile.pkg .
  3. Build the productive image using the image built in the previous step: DOCKER_BUILDKIT=1 docker build -t rspamd:3.9.1 --build-arg=PKG_IMG=rspamd_pkg --build-arg=PKG_TAG=3.9.1 .
k3ck3c commented 2 months ago

thanks

the first command went fine, on the second I got

gg@debian:~/rspamd-docker main 8m3s ± DOCKER_BUILDKIT=1 docker build -t rspamd:3.9.1 --build-arg=PKG_IMG=rspamd_pkg --build-arg=PKG_TAG=3.9.1 .                                                         
[+] Building 43.9s (12/12) FINISHED                                                                                                                                                                 docker:default
 => [internal] load build definition from Dockerfile                                                                                                                                                          0.0s
 => => transferring dockerfile: 1.46kB                                                                                                                                                                        0.0s
 => WARN: InvalidDefaultArgInFrom: Default value for ARG ${PKG_IMG}:${PKG_TAG} results in empty or invalid base image name (line 5)                                                                           0.0s
 => [internal] load metadata for docker.io/library/rspamd_pkg:3.9.1                                                                                                                                           0.0s
 => [internal] load metadata for docker.io/library/debian:bookworm-slim                                                                                                                                       1.3s
 => [auth] library/debian:pull token for registry-1.docker.io                                                                                                                                                 0.0s
 => [internal] load .dockerignore                                              
...

but I eventually get an image

rspamd 3.9.1 52e76208fd2a 38 seconds ago 190MB

So I guess this is correct