Reap zombie processes and perform singal forward in dev container

Signed-off-by: quicksilver <zhifeng.zhang@zilliz.com>
pull/4973/head^2
quicksilver 2021-02-23 19:34:41 +08:00 committed by yefu.chen
parent 7c5e2d89f6
commit 3cc071c1b5
2 changed files with 6 additions and 39 deletions

View File

@ -44,26 +44,18 @@ RUN mkdir -p /usr/local/go && wget -qO- "https://golang.org/dl/go1.15.2.linux-am
chmod -R 777 "$GOPATH" && chmod -R a+w $(go env GOTOOLDIR) chmod -R 777 "$GOPATH" && chmod -R a+w $(go env GOTOOLDIR)
RUN apt-get update && apt-get install -y --no-install-recommends \ RUN apt-get update && apt-get install -y --no-install-recommends \
openssh-server gdb gdbserver && \ gdb gdbserver && \
apt-get remove --purge -y && \ apt-get remove --purge -y && \
rm -rf /var/lib/apt/lists/* rm -rf /var/lib/apt/lists/*
# Taken from - https://docs.docker.com/engine/examples/running_ssh_service/#environment-variables RUN echo 'root:root' | chpasswd
RUN mkdir /var/run/sshd && echo 'root:root' | chpasswd && \
useradd -u 2000 -ms /bin/bash debugger && echo 'debugger:milvus' | chpasswd
# SSH login fix. Otherwise user is kicked off after login
RUN sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd
ENV NOTVISIBLE "in users profile"
RUN echo "export VISIBLE=now" >> /etc/profile
# 22 for ssh server. 7777 for gdb server.
EXPOSE 22 7777
COPY --chown=0:0 build/docker/env/entrypoint.sh / COPY --chown=0:0 build/docker/env/entrypoint.sh /
RUN wget -qO- "https://github.com/benesch/autouseradd/releases/download/1.2.0/autouseradd-1.2.0-amd64.tar.gz" | tar xz -C / --strip-components 1 RUN wget -qO- "https://github.com/benesch/autouseradd/releases/download/1.2.0/autouseradd-1.2.0-amd64.tar.gz" | tar xz -C / --strip-components 1
ENTRYPOINT [ "autouseradd", "--user", "milvus", "--", "/entrypoint.sh" ] RUN wget -O /tini https://github.com/krallin/tini/releases/download/v0.19.0/tini && \
chmod +x /tini
ENTRYPOINT [ "/tini", "--", "autouseradd", "--user", "milvus", "--", "/entrypoint.sh" ]
CMD ["tail", "-f", "/dev/null"] CMD ["tail", "-f", "/dev/null"]

View File

@ -35,31 +35,6 @@ services:
networks: networks:
- milvus - milvus
# gdbserver:
# image: ${REPO}:${ARCH}-ubuntu${UBUNTU}-${DATE_VERSION}
# build:
# context: .
# dockerfile: build/docker/env/cpu/ubuntu${UBUNTU}/Dockerfile
# cache_from:
# - ${REPO}:${ARCH}-ubuntu${UBUNTU}-${LATEST_DATE_VERSION}
# security_opt: # options needed for gdb debugging
# - seccomp:unconfined
# - apparmor:unconfined
# environment:
# PULSAR_ADDRESS: ${PULSAR_ADDRESS}
# ETCD_ADDRESS: ${ETCD_ADDRESS}
# MINIO_ADDRESS: ${MINIO_ADDRESS}
# volumes:
# - .:/go/src/github.com/zilliztech/milvus-distributed:delegated
# - ${DOCKER_VOLUME_DIRECTORY:-.docker}/${ARCH}-ubuntu${UBUNTU}-gdbserver-home:/home/debugger:delegated
# container_name: debugger
# entrypoint: ["/usr/sbin/sshd", "-D"]
# ports:
# - "7776:22"
# - "7777:7777"
# networks:
# - milvus
etcd: etcd:
image: quay.io/coreos/etcd:v3.4.13 image: quay.io/coreos/etcd:v3.4.13
command: etcd -advertise-client-urls=http://127.0.0.1:2379 -listen-client-urls http://0.0.0.0:2379 command: etcd -advertise-client-urls=http://127.0.0.1:2379 -listen-client-urls http://0.0.0.0:2379