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

documentation about the build arguments #33

Open
k3ck3c opened this issue Aug 30, 2024 · 2 comments
Open

documentation about the build arguments #33

k3ck3c opened this issue Aug 30, 2024 · 2 comments

Comments

@k3ck3c
Copy link

k3ck3c commented Aug 30, 2024

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
Copy link
Member

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
Copy link
Author

k3ck3c commented Aug 30, 2024

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

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

No branches or pull requests

2 participants