/
githubmirror
/
kubernetes
Обзор
Документация
Войти
/
githubmirror
/
kubernetes
Код
Запросы
0
Пакеты
0
Релизы
0
Аналитика
Безопасность
master
test/images/agnhost/Dockerfile
88 строк
3 KB
suii2210
test/images: add socat to agnhost
15 июн 2026, 13:40
15 июн 2026, 13:40
312e892
Код
Авторство
О чём код?
# Copyright 2019 The Kubernetes Authors. # # Licensed under the Apache License, Version 2.0 (the "License"); # you may not use this file except in compliance with the License. # You may obtain a copy of the License at # # http://www.apache.org/licenses/LICENSE-2.0 # # Unless required by applicable law or agreed to in writing, software # distributed under the License is distributed on an "AS IS" BASIS, # WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. # See the License for the specific language governing permissions and # limitations under the License. # If we ever move agnhost away from alpine, we may need changes to # test/e2e/network/dns.go, which assumes that agnhost's `dig` binary # is linked against musl libc. ARG BASEIMAGE=alpine # latest as of 2026-05-08 FROM golang@sha256:efaccb5b497e90df3ebe5216cc25cd9f98e73874e2d638b56e38d4a3f098c41c AS preparer ARG GOLANG_VERSION ARG GOTOOLCHAIN=go${GOLANG_VERSION} RUN go install github.com/google/go-containerregistry/cmd/crane@latest && \ apt-get update && apt-get install -y jq COPY fakeregistryserver/prepare_registry.sh /prepare_registry.sh COPY fakeregistryserver/images.txt /images.txt RUN chmod +x /prepare_registry.sh # run the script during the build to create the artifact inside the image RUN /prepare_registry.sh FROM $BASEIMAGE AS main ARG TARGETARCH # from dnsutils image # install necessary packages: # - bind-tools: contains dig, which can used in DNS tests. # - CoreDNS: used in some DNS tests. # from hostexec image # install necessary packages: # - curl, nc: used by a lot of e2e tests # - iproute2: includes ss used in NodePort tests # - util-linux-misc: includes ipcs used in SELinux tests # from iperf image # install necessary packages: iperf, bash RUN apk --update add bind-tools curl netcat-openbsd iproute2 iperf bash util-linux-misc socat && rm -rf /var/cache/apk/* \ && ln -s /usr/bin/iperf /usr/local/bin/iperf \ && ls -altrh /usr/local/bin/iperf ADD https://github.com/coredns/coredns/releases/download/v1.6.2/coredns_1.6.2_linux_${TARGETARCH}.tgz /coredns.tgz RUN tar -xzvf /coredns.tgz && rm -f /coredns.tgz # PORT 80 needed by: test-webserver # PORT 8080 needed by: netexec, nettest, resource-consumer, resource-consumer-controller # PORT 8081 needed by: netexec # PORT 9376 needed by: serve-hostname # PORT 5000 needed by: grpc-health-checking, fake-registry-server EXPOSE 80 8080 8081 9376 5000 # from netexec RUN mkdir /uploads # from porter ADD porter/localhost.crt localhost.crt ADD porter/localhost.key localhost.key ADD agnhost agnhost COPY --from=preparer /registry /var/registry # needed for the entrypoint-tester related tests. Some of the entrypoint-tester related tests # overrides this image's entrypoint with agnhost-2 binary, and will verify that the correct # entrypoint is used by the containers. RUN ln -s agnhost agnhost-2 # this user and group is used in a E2E test case of # SupplementalGroups with pre-defined group in the image # - user-defined-in-image(uid=1000) # - user-defined-in-image belongs to group-defined-in-image(gid=50000) RUN adduser -u 1000 -D user-defined-in-image && \ addgroup -g 50000 group-defined-in-image && \ addgroup user-defined-in-image group-defined-in-image ENTRYPOINT ["/agnhost"] CMD ["pause"]