From 03b86b41451af3325ec4b83f5364d8caea26e2e9 Mon Sep 17 00:00:00 2001 From: Akihiro Suda Date: Wed, 9 Dec 2020 14:54:05 +0900 Subject: [PATCH] rootless-install.sh: remove v19.03 functions Signed-off-by: Akihiro Suda --- rootless-install.sh | 151 +------------------------------------------- 1 file changed, 2 insertions(+), 149 deletions(-) diff --git a/rootless-install.sh b/rootless-install.sh index e058a30..a4ec721 100755 --- a/rootless-install.sh +++ b/rootless-install.sh @@ -62,11 +62,6 @@ init_vars() { if systemctl --user daemon-reload >/dev/null 2>&1; then SYSTEMD=1 fi - - V1903= - if [ "$CHANNEL" = "stable" ] && ( echo "$STABLE_LATEST" | grep -q "^19\.03" ); then - V1903=1 - fi } checks() { @@ -113,22 +108,13 @@ checks() { >&2 echo "- or simply log back in as the desired unprivileged user (ssh works for remote machines)" exit 1 fi - if [ -n "$V1903" ]; then - export XDG_RUNTIME_DIR="$HOME/.docker/run" - mkdir -p -m 700 "$XDG_RUNTIME_DIR" - XDG_RUNTIME_DIR_CREATED=1 - fi fi # Already installed verification (unless force?). Only having docker cli binary previously shouldn't fail the build. if [ -x "$BIN/$DAEMON" ]; then # If rootless installation is detected print out the modified PATH and DOCKER_HOST that needs to be set. echo "# Existing rootless Docker detected at $BIN/$DAEMON" - if [ -n "$V1903" ]; then - v1903_print_instructions - else - echo "# See https://docs.docker.com/engine/security/rootless/ for the usage." - fi + echo "# See https://docs.docker.com/engine/security/rootless/ for the usage." exit 0 fi @@ -219,135 +205,6 @@ echo \"$(id -un):100000:65536\" >> /etc/subgid" fi } -v1903_start_docker() { - # detect if overlay is supported (ubuntu) - tmpdir=$(mktemp -d) - mkdir -p $tmpdir/lower $tmpdir/upper $tmpdir/work $tmpdir/merged - if "$BIN"/rootlesskit mount -t overlay overlay -olowerdir=$tmpdir/lower,upperdir=$tmpdir/upper,workdir=$tmpdir/work $tmpdir/merged >/dev/null 2>&1; then - USE_OVERLAY=1 - fi - rm -rf "$tmpdir" - - if [ -z "$SYSTEMD" ]; then - v1903_start_docker_nonsystemd - return - fi - - mkdir -p $HOME/.config/systemd/user - - DOCKERD_FLAGS="--experimental" - - if [ -n "$SKIP_IPTABLES" ]; then - DOCKERD_FLAGS="$DOCKERD_FLAGS --iptables=false" - fi - - if [ "$USE_OVERLAY" = "1" ]; then - DOCKERD_FLAGS="$DOCKERD_FLAGS --storage-driver=overlay2" - else - DOCKERD_FLAGS="$DOCKERD_FLAGS --storage-driver=vfs" - fi - - CFG_DIR="$HOME/.config" - if [ -n "$XDG_CONFIG_HOME" ]; then - CFG_DIR="$XDG_CONFIG_HOME" - fi - - - if [ ! -f $CFG_DIR/systemd/user/docker.service ]; then - cat < $CFG_DIR/systemd/user/docker.service -[Unit] -Description=Docker Application Container Engine (Rootless) -Documentation=https://docs.docker.com - -[Service] -Environment=PATH=$BIN:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin -ExecStart=$BIN/dockerd-rootless.sh $DOCKERD_FLAGS -ExecReload=/bin/kill -s HUP \$MAINPID -TimeoutSec=0 -RestartSec=2 -Restart=always -StartLimitBurst=3 -StartLimitInterval=60s -LimitNOFILE=infinity -LimitNPROC=infinity -LimitCORE=infinity -TasksMax=infinity -Delegate=yes -Type=simple - -[Install] -WantedBy=default.target -EOT - systemctl --user daemon-reload - fi - if ! systemctl --user status docker >/dev/null 2>&1; then - echo "# starting systemd service" - systemctl --user start docker - fi - systemctl --user status docker | cat - - sleep 1 - PATH="$BIN:$PATH" DOCKER_HOST="unix://$XDG_RUNTIME_DIR/docker.sock" docker version -} - -v1903_service_instructions() { - if [ -z "$SYSTEMD" ]; then - return - fi - cat </dev/null 2>&1; then - if [ -f /sbin/iptables ]; then - echo "export PATH=\$PATH:/sbin" - elif [ -f /usr/sbin/iptables ]; then - echo "export PATH=\$PATH:/usr/sbin" - fi - fi - - echo "export DOCKER_HOST=unix://$XDG_RUNTIME_DIR/docker.sock" - echo - v1903_service_instructions -} - exec_setuptool() { if [ -n "$FORCE_ROOTLESS_INSTALL" ]; then set -- "$@" --force @@ -381,11 +238,7 @@ do_install() { tar zxf "$tmp/rootless.tgz" --strip-components=1 ) - if [ -n "$V1903" ]; then - v1903_print_instructions - else - exec_setuptool "$@" - fi + exec_setuptool "$@" } do_install "$@"