docker: distribute geoip db in slim image (#2920)
This commit is contained in:
parent
63bd31b471
commit
26bcd0912a
3 changed files with 4 additions and 11 deletions
11
Dockerfile
11
Dockerfile
|
@ -43,11 +43,12 @@ COPY --from=build /go/bin/yq /usr/local/bin/crowdsec /usr/local/bin/cscli /usr/l
|
|||
COPY --from=build /etc/crowdsec /staging/etc/crowdsec
|
||||
COPY --from=build /go/src/crowdsec/docker/docker_start.sh /
|
||||
COPY --from=build /go/src/crowdsec/docker/config.yaml /staging/etc/crowdsec/config.yaml
|
||||
COPY --from=build /var/lib/crowdsec /staging/var/lib/crowdsec
|
||||
RUN yq -n '.url="http://0.0.0.0:8080"' | install -m 0600 /dev/stdin /staging/etc/crowdsec/local_api_credentials.yaml
|
||||
|
||||
ENTRYPOINT /bin/bash /docker_start.sh
|
||||
|
||||
FROM slim as plugins
|
||||
FROM slim as full
|
||||
|
||||
# Due to the wizard using cp -n, we have to copy the config files directly from the source as -n does not exist in busybox cp
|
||||
# The files are here for reference, as users will need to mount a new version to be actually able to use notifications
|
||||
|
@ -60,11 +61,3 @@ COPY --from=build \
|
|||
/staging/etc/crowdsec/notifications/
|
||||
|
||||
COPY --from=build /usr/local/lib/crowdsec/plugins /usr/local/lib/crowdsec/plugins
|
||||
|
||||
FROM slim as geoip
|
||||
|
||||
COPY --from=build /var/lib/crowdsec /staging/var/lib/crowdsec
|
||||
|
||||
FROM plugins as full
|
||||
|
||||
COPY --from=build /var/lib/crowdsec /staging/var/lib/crowdsec
|
||||
|
|
|
@ -6,7 +6,7 @@ CROWDSEC_TEST_VERSION="dev"
|
|||
# All of the following flavors will be tested when using the "flavor" fixture
|
||||
CROWDSEC_TEST_FLAVORS="full"
|
||||
# CROWDSEC_TEST_FLAVORS="full,slim,debian"
|
||||
# CROWDSEC_TEST_FLAVORS="full,slim,debian,geoip,plugins-debian-slim,debian-geoip,debian-plugins"
|
||||
# CROWDSEC_TEST_FLAVORS="full,slim,debian,debian-slim"
|
||||
|
||||
# network to use
|
||||
CROWDSEC_TEST_NETWORK="net-test"
|
||||
|
|
|
@ -42,7 +42,7 @@ def test_flavor_content(crowdsec, flavor):
|
|||
x = cs.cont.exec_run(
|
||||
'ls -1 /usr/local/lib/crowdsec/plugins/')
|
||||
stdout = x.output.decode()
|
||||
if 'slim' in flavor or 'geoip' in flavor:
|
||||
if 'slim' in flavor:
|
||||
# the exact return code and full message depend
|
||||
# on the 'ls' implementation (busybox vs coreutils)
|
||||
assert x.exit_code != 0
|
||||
|
|
Loading…
Reference in a new issue