diff --git a/build/docker/env/cpu/ubuntu18.04/Dockerfile b/build/docker/env/cpu/ubuntu18.04/Dockerfile index 2815f2000c..870de37cff 100644 --- a/build/docker/env/cpu/ubuntu18.04/Dockerfile +++ b/build/docker/env/cpu/ubuntu18.04/Dockerfile @@ -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) RUN apt-get update && apt-get install -y --no-install-recommends \ - openssh-server gdb gdbserver && \ + gdb gdbserver && \ apt-get remove --purge -y && \ rm -rf /var/lib/apt/lists/* -# Taken from - https://docs.docker.com/engine/examples/running_ssh_service/#environment-variables -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 +RUN echo 'root:root' | chpasswd 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 -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"] diff --git a/docker-compose.yml b/docker-compose.yml index 4f7f32bcd7..294f1f842b 100644 --- a/docker-compose.yml +++ b/docker-compose.yml @@ -35,31 +35,6 @@ services: networks: - 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: 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