This commit is contained in:
Haitao Pan 2023-03-10 12:53:01 +08:00
parent 540917ac74
commit 1000c30417

View File

@ -2,36 +2,8 @@
# Preparation stage: layout and chmods #
########################################
FROM artifact.onwalk.net/public/ubuntu:22.04 as builder
ARG TARGETARCH
LABEL baseimage.os "ubuntu jammy LTS"
LABEL baseimage.name "ubuntu:22.04"
WORKDIR /output
COPY datadog-cluster-agent.$TARGETARCH opt/datadog-agent/bin/datadog-cluster-agent
COPY ./conf.d etc/datadog-agent/conf.d
COPY ./datadog-cluster.yaml etc/datadog-agent/datadog-cluster.yaml
COPY ./security-agent-policies/compliance/containers/ etc/datadog-agent/compliance.d
COPY ./install_info etc/datadog-agent/install_info
COPY entrypoint.sh .
COPY readsecret.sh readsecret_multiple_providers.sh ./
RUN chmod 755 entrypoint.sh \
&& chown root:root readsecret.sh readsecret_multiple_providers.sh \
&& chmod 550 readsecret.sh readsecret_multiple_providers.sh \
&& chmod g+r,g+w,g+X -R etc/datadog-agent/ \
&& chmod +x opt/datadog-agent/bin/datadog-cluster-agent \
&& ln -s /opt/datadog-agent/bin/datadog-cluster-agent opt/datadog-agent/bin/agent
FROM builder AS nosys-seccomp
COPY nosys-seccomp/nosys.c /tmp/nosys.c
COPY nosys-seccomp/nosys.sym /tmp/nosys.sym
ENV DEBIAN_FRONTEND=noninteractive
RUN apt update && apt install --no-install-recommends -y gcc libc6-dev libseccomp-dev
RUN gcc -pipe -Wall -Wextra -O2 -shared -fPIC -Wl,--version-script=/tmp/nosys.sym -o /tmp/nosys.so /tmp/nosys.c -lseccomp
FROM artifact.onwalk.net/k8s/datadog/cluster-agent:latest AS builder
FROM artifact.onwalk.net/k8s/datadog/cluster-agent:latest AS nosys-seccomp
####################################
# Actual docker image construction #