contrib/docker: knot-resolver - support SIGTERM

parent 97c530ca
...@@ -39,4 +39,6 @@ RUN make install PREFIX=/var/opt/knot-resolver/.install ...@@ -39,4 +39,6 @@ RUN make install PREFIX=/var/opt/knot-resolver/.install
RUN mkdir /log RUN mkdir /log
CMD /var/opt/knot-resolver/.install/sbin/kresd -c /etc/knot-resolver/kresd.conf -K /etc/knot-resolver/root.keys -v -f 1 /dev/shm >> /log/kresd.log COPY kresd.entrypoint.sh /
ENTRYPOINT ["/kresd.entrypoint.sh"]
#!/bin/bash
exec /var/opt/knot-resolver/.install/sbin/kresd -c /etc/knot-resolver/kresd.conf -K /etc/knot-resolver/root.keys -v -f 1 /dev/shm >> /log/kresd.log
...@@ -78,6 +78,7 @@ def create_resolver_configs(directory: str, config: Dict[str, Any]): ...@@ -78,6 +78,7 @@ def create_resolver_configs(directory: str, config: Dict[str, Any]):
if not os.path.exists(dockerfile_dir): if not os.path.exists(dockerfile_dir):
os.makedirs(dockerfile_dir) os.makedirs(dockerfile_dir)
copy_file('Dockerfile.knot-resolver', dockerfile_dir, 'Dockerfile') copy_file('Dockerfile.knot-resolver', dockerfile_dir, 'Dockerfile')
copy_file('kresd.entrypoint.sh', dockerfile_dir)
create_file_from_template( create_file_from_template(
'kresd.conf.j2', resolver, directory, name + '.conf') 'kresd.conf.j2', resolver, directory, name + '.conf')
copy_file('root.keys', directory) copy_file('root.keys', directory)
......
...@@ -20,6 +20,10 @@ services: ...@@ -20,6 +20,10 @@ services:
KNOT_BRANCH: ${KNOT_BRANCH} KNOT_BRANCH: ${KNOT_BRANCH}
CFLAGS: {{ '-ggdb3 -O0 -fsanitize=address -fno-omit-frame-pointer' if asan else "''" }} CFLAGS: {{ '-ggdb3 -O0 -fsanitize=address -fno-omit-frame-pointer' if asan else "''" }}
image: knot-resolver:{{ git_sha }}{{ '-asan' if asan else '' }} image: knot-resolver:{{ git_sha }}{{ '-asan' if asan else '' }}
{%- if asan %}
cap_add:
- SYS_PTRACE
{%- endif %}
volumes: volumes:
- "./{{ name }}.conf:/etc/knot-resolver/kresd.conf:ro" - "./{{ name }}.conf:/etc/knot-resolver/kresd.conf:ro"
- "./root.keys:/etc/knot-resolver/root.keys:ro" - "./root.keys:/etc/knot-resolver/root.keys:ro"
......
../../docker/knot-resolver/kresd.entrypoint.sh
\ No newline at end of file
...@@ -12,7 +12,7 @@ tar -czf ${JOBNAME}_logs.tar.gz -T /dev/null # empty tar by default ...@@ -12,7 +12,7 @@ tar -czf ${JOBNAME}_logs.tar.gz -T /dev/null # empty tar by default
# HACK (condor): Create proper dir structure # HACK (condor): Create proper dir structure
mkdir -p docker-knot-resolver || : mkdir -p docker-knot-resolver || :
mv Dockerfile docker-knot-resolver/ || : mv -t docker-knot-resolver/ Dockerfile kresd.entrypoint.sh || :
# Check no other docker containers are running # Check no other docker containers are running
if [ -n "$(docker ps -q)" ]; then if [ -n "$(docker ps -q)" ]; then
......
...@@ -19,7 +19,7 @@ tar -czf ${JOBNAME}_logs.tar.gz -T /dev/null # empty tar by default ...@@ -19,7 +19,7 @@ tar -czf ${JOBNAME}_logs.tar.gz -T /dev/null # empty tar by default
# HACK (condor): Create proper dir structure # HACK (condor): Create proper dir structure
mkdir -p docker-knot-resolver || : mkdir -p docker-knot-resolver || :
mv Dockerfile docker-knot-resolver/ || : mv -t docker-knot-resolver/ Dockerfile kresd.entrypoint.sh || :
# HACK (condor): set PATH, otherwise docker-compose exec will fail # HACK (condor): set PATH, otherwise docker-compose exec will fail
export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" export PATH="/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin"
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment