From f910ec11a843ebf596fc05e38f5683458aff223e Mon Sep 17 00:00:00 2001 From: Pagan Gazzard Date: Mon, 18 Apr 2016 18:13:23 +0100 Subject: [PATCH] Remove even more old terminal related stuff. --- Dockerfile.amd64 | 4 +--- Dockerfile.armel | 4 +--- Dockerfile.armv7hf | 4 +--- Dockerfile.i386 | 4 +--- Dockerfile.rpi | 4 +--- bin/enter.sh | 14 -------------- entry.sh | 6 ------ src/enterContainer.sh | 17 ----------------- tools/dind/Dockerfile | 2 -- .../resin-supervisor-host-socket.service | 17 ----------------- 10 files changed, 5 insertions(+), 71 deletions(-) delete mode 100644 bin/enter.sh delete mode 100644 src/enterContainer.sh delete mode 100644 tools/dind/config/services/resin-supervisor-host-socket.service diff --git a/Dockerfile.amd64 b/Dockerfile.amd64 index 9c249b38..dd1206ac 100644 --- a/Dockerfile.amd64 +++ b/Dockerfile.amd64 @@ -8,7 +8,6 @@ RUN apt-get -q update \ btrfs-tools \ ca-certificates \ rsync \ - socat \ supervisor \ --no-install-recommends \ && apt-get clean \ @@ -34,8 +33,7 @@ RUN apt-get -q update \ # Copy source COPY . /app/ -RUN chmod +x /app/src/enterContainer.sh \ - && /app/node_modules/.bin/coffee -c /app/src \ +RUN /app/node_modules/.bin/coffee -c /app/src \ && ln -sf /app/entry.sh /start # Needed for legacy RUN chmod +x /app/bin/gosuper diff --git a/Dockerfile.armel b/Dockerfile.armel index eeef7035..894a69c1 100644 --- a/Dockerfile.armel +++ b/Dockerfile.armel @@ -8,7 +8,6 @@ RUN apt-get -q update \ btrfs-tools \ ca-certificates \ rsync \ - socat \ supervisor \ --no-install-recommends \ && apt-get clean \ @@ -34,8 +33,7 @@ RUN apt-get -q update \ # Copy source COPY . /app/ -RUN chmod +x /app/src/enterContainer.sh \ - && /app/node_modules/.bin/coffee -c /app/src \ +RUN /app/node_modules/.bin/coffee -c /app/src \ && ln -sf /app/entry.sh /start # Needed for legacy RUN chmod +x /app/bin/gosuper diff --git a/Dockerfile.armv7hf b/Dockerfile.armv7hf index 972b2dbf..ea693eeb 100644 --- a/Dockerfile.armv7hf +++ b/Dockerfile.armv7hf @@ -8,7 +8,6 @@ RUN apt-get -q update \ btrfs-tools \ ca-certificates \ rsync \ - socat \ supervisor \ --no-install-recommends \ && apt-get clean \ @@ -34,8 +33,7 @@ RUN apt-get -q update \ # Copy source COPY . /app/ -RUN chmod +x /app/src/enterContainer.sh \ - && /app/node_modules/.bin/coffee -c /app/src \ +RUN /app/node_modules/.bin/coffee -c /app/src \ && ln -sf /app/entry.sh /start # Needed for legacy RUN chmod +x /app/bin/gosuper diff --git a/Dockerfile.i386 b/Dockerfile.i386 index 137e487f..13aa2a57 100644 --- a/Dockerfile.i386 +++ b/Dockerfile.i386 @@ -8,7 +8,6 @@ RUN apt-get -q update \ btrfs-tools \ ca-certificates \ rsync \ - socat \ supervisor \ --no-install-recommends \ && apt-get clean \ @@ -34,8 +33,7 @@ RUN apt-get -q update \ # Copy source COPY . /app/ -RUN chmod +x /app/src/enterContainer.sh \ - && /app/node_modules/.bin/coffee -c /app/src \ +RUN /app/node_modules/.bin/coffee -c /app/src \ && ln -sf /app/entry.sh /start # Needed for legacy RUN chmod +x /app/bin/gosuper diff --git a/Dockerfile.rpi b/Dockerfile.rpi index 4eedf1be..a828473d 100644 --- a/Dockerfile.rpi +++ b/Dockerfile.rpi @@ -8,7 +8,6 @@ RUN apt-get -q update \ btrfs-tools \ ca-certificates \ rsync \ - socat \ supervisor \ --no-install-recommends \ && apt-get clean \ @@ -34,8 +33,7 @@ RUN apt-get -q update \ # Copy source COPY . /app/ -RUN chmod +x /app/src/enterContainer.sh \ - && /app/node_modules/.bin/coffee -c /app/src \ +RUN /app/node_modules/.bin/coffee -c /app/src \ && ln -sf /app/entry.sh /start # Needed for legacy RUN chmod +x /app/bin/gosuper diff --git a/bin/enter.sh b/bin/enter.sh deleted file mode 100644 index 012c2f5b..00000000 --- a/bin/enter.sh +++ /dev/null @@ -1,14 +0,0 @@ -#!/bin/bash - -if [ -f /usr/bin/rce ]; then - ENGINE=rce -else - ENGINE=docker -fi - -CONTAINER_PID=$($ENGINE inspect --format '{{if .State.Running}}{{.State.Pid}}{{end}}' $1) -if [ -z $CONTAINER_PID ]; then - read -p "Application must be running for a terminal to be started." -else - nsenter --target $CONTAINER_PID --mount --uts --ipc --net --pid -- bash -c 'while IFS= read -r -d "" var; do export "$var"; done < /proc/1/environ; exec bash' -fi diff --git a/entry.sh b/entry.sh index a480cda4..810ce256 100755 --- a/entry.sh +++ b/entry.sh @@ -9,12 +9,6 @@ set -e cd /app -DATA_DIRECTORY=/data -if [ -d "$DATA_DIRECTORY" ]; then - cp bin/enter.sh $DATA_DIRECTORY/enter.sh - chmod +x $DATA_DIRECTORY/enter.sh -fi - mkdir -p /var/log/supervisor && touch /var/log/supervisor/supervisord.log mkdir -p /var/run/resin mount -t tmpfs -o size=1m tmpfs /var/run/resin diff --git a/src/enterContainer.sh b/src/enterContainer.sh deleted file mode 100644 index ac35759f..00000000 --- a/src/enterContainer.sh +++ /dev/null @@ -1,17 +0,0 @@ -#!/bin/bash -SOCKET_NAME=test-${1}-${2}-${3} -HOST_DATA_PATH=/resin-data/resin-supervisor -HOST_SOCKET=${HOST_DATA_PATH}/${SOCKET_NAME} -SUPERVISOR_SOCKET_PATH=/data -COMMAND_SOCKET=${SUPERVISOR_SOCKET_PATH}/host - -if [ ! -S ${COMMAND_SOCKET} ]; then - read -p 'TTY mode not supported on this image, please update.' -else - echo " - rm -f ${HOST_SOCKET} - socat UNIX-LISTEN:${HOST_SOCKET} EXEC:'${HOST_DATA_PATH}/enter.sh ${1}',pty,setsid,setpgid,stderr,ctty & - exit - " | socat UNIX:${COMMAND_SOCKET} - >& /dev/null - socat UNIX:${SUPERVISOR_SOCKET_PATH}/${SOCKET_NAME} -,raw,echo=0 -fi diff --git a/tools/dind/Dockerfile b/tools/dind/Dockerfile index f2302569..3aa5faf6 100644 --- a/tools/dind/Dockerfile +++ b/tools/dind/Dockerfile @@ -36,7 +36,6 @@ RUN apt-get update \ python-dev \ rsyslog \ rsyslog-gnutls \ - socat \ vim \ wget \ && rm -rf /var/lib/apt/lists/* @@ -83,6 +82,5 @@ COPY config/services/ /etc/systemd/system/ COPY resin-vars vpn-init /usr/src/app/ RUN systemctl enable resin-supervisor-dind -RUN systemctl enable resin-supervisor-host-socket CMD env > /etc/docker.env; exec /sbin/init diff --git a/tools/dind/config/services/resin-supervisor-host-socket.service b/tools/dind/config/services/resin-supervisor-host-socket.service deleted file mode 100644 index b2b08f9a..00000000 --- a/tools/dind/config/services/resin-supervisor-host-socket.service +++ /dev/null @@ -1,17 +0,0 @@ -[Unit] -Description=Host socket for resin supervisor -Requires=resin-supervisor.service -After=resin-supervisor.service - -[Service] -Restart=always -ExecStartPre=-/bin/rm -f /resin-data/resin-supervisor/host -ExecStart=/bin/bash -c ' \ - while true; do \ - rm -f /resin-data/resin-supervisor/host; \ - socat UNIX-LISTEN:/resin-data/resin-supervisor/host EXEC:/bin/bash,pty,setsid,setpgid,stderr,ctty; \ - done' -ExecStopPost=-/bin/rm -f /resin-data/resin-supervisor/host - -[Install] -WantedBy=multi-user.target