File tree Expand file tree Collapse file tree
Expand file tree Collapse file tree Original file line number Diff line number Diff line change 1- FROM debian:10
1+ FROM debian:12
22ENV container docker
33ENV LC_ALL C
44ENV DEBIAN_FRONTEND noninteractive
Original file line number Diff line number Diff line change 1- FROM centos:8
1+ FROM rockylinux:9
22ENV container docker
3- RUN (cd /lib/systemd/system/sysinit.target.wants/; for i in *; do [ $i == \
4- systemd-tmpfiles-setup.service ] || rm -f $i; done); \
5- rm -f /lib/systemd/system/multi-user.target.wants/*; \
3+ RUN dnf -y install systemd && dnf clean all && \
4+ (cd /usr/lib/systemd/system/sysinit.target.wants/; for i in *; do [ "$i" = \
5+ systemd-tmpfiles-setup.service ] || rm -f "$i" ; done); \
6+ rm -f /usr/lib/systemd/system/multi-user.target.wants/*; \
67 rm -f /etc/systemd/system/*.wants/*; \
7- rm -f /lib/systemd/system/local-fs.target.wants/*; \
8- rm -f /lib/systemd/system/sockets.target.wants/*udev*; \
9- rm -f /lib/systemd/system/sockets.target.wants/*initctl*; \
10- rm -f /lib/systemd/system/basic.target.wants/*; \
11- rm -f /lib/systemd/system/anaconda.target.wants/*;
8+ rm -f /usr/lib/systemd/system/local-fs.target.wants/*; \
9+ rm -f /usr/lib/systemd/system/sockets.target.wants/*udev*; \
10+ rm -f /usr/lib/systemd/system/sockets.target.wants/*initctl*; \
11+ rm -f /usr/lib/systemd/system/basic.target.wants/*;
1212
1313VOLUME [ "/sys/fs/cgroup" ]
1414CMD ["/usr/sbin/init" ]
Original file line number Diff line number Diff line change @@ -46,14 +46,23 @@ function test_with_systemd() {
4646
4747 echo " Testing $install_command on $image ($platform )"
4848
49- container=$( docker run --platform=" ${platform} " --tmpfs /run --tmpfs /run/lock -v /sys/fs/cgroup:/sys/fs/cgroup:ro -itd -v " $( pwd) " /dist:/opt/cortex -p 9009 " ${image} " )
49+ container=$( docker run --platform=" ${platform} " --privileged -- tmpfs /run --tmpfs /run/lock -v /sys/fs/cgroup:/sys/fs/cgroup -td -v " $( pwd) " /dist:/opt/cortex -v " $( pwd ) " /docs/configuration:/opt/config:ro -p 9009 " ${image} " )
5050 CONTAINERS+=(" ${container} " )
5151
5252 port=$( docker inspect --format=' {{(index (index .NetworkSettings.Ports "9009/tcp") 0).HostPort}}' " ${container} " )
5353
54- docker exec -it " ${container} " /bin/bash -c " ${install_command} ; systemctl start cortex.service; systemctl enable cortex.service"
55-
56- ready 10 1 " ${port} " || error " Testing image: ${image} with command: '${install_command} ' failed"
54+ docker exec " ${container} " /bin/bash -c " ${install_command} ; mkdir -p /tmp/cortex/tsdb /tmp/cortex/tsdb-sync /tmp/cortex/compactor /tmp/cortex/rules /tmp/cortex/alerts /var/lib/cortex/data/tsdb && chown -R cortex:cortex /tmp/cortex /var/lib/cortex; cp /opt/config/single-process-config-blocks-local.yaml /etc/cortex/single-process-config.yaml && chown root:cortex /etc/cortex/single-process-config.yaml; systemctl start cortex.service; systemctl enable cortex.service"
55+
56+ ready 30 2 " ${port} " || {
57+ echo " --- curl localhost:${port} /ready ---"
58+ curl -s localhost:" ${port} " /ready || true
59+ echo " "
60+ echo " --- systemctl status cortex.service ---"
61+ docker exec " ${container} " systemctl status cortex.service || true
62+ echo " --- journalctl -u cortex.service ---"
63+ docker exec " ${container} " journalctl -u cortex.service --no-pager -n 50 || true
64+ error " Testing image: ${image} with command: '${install_command} ' failed"
65+ }
5766}
5867
5968test_with_systemd " ${IMAGE_PREFIX} " debian-systemd:amd64 linux/amd64 " dpkg -i /opt/cortex/cortex-${VERSION} _amd64.deb"
You can’t perform that action at this time.
0 commit comments