diff --git a/Dockerfile b/Dockerfile index 748c4f34cf3..b6215dce837 100644 --- a/Dockerfile +++ b/Dockerfile @@ -18,7 +18,13 @@ COPY ./build/package/ /tmp SHELL ["/bin/bash", "-o", "pipefail", "-c"] # hadolint ignore=DL3005,DL3008 -RUN echo "dokku dokku/hostname string $DOKKU_HOSTNAME" | debconf-set-selections \ +RUN mkdir -p /etc/apt/keyrings \ + && mkdir -p /etc/apt/keyrings \ + && curl -fsSL https://download.docker.com/linux/ubuntu/gpg | gpg --dearmor -o /etc/apt/keyrings/docker.gpg \ + && echo "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | tee /etc/apt/sources.list.d/docker.list > /dev/null \ + && apt-get update \ + && apt-get -y --no-install-recommends install docker-ce docker-ce-cli containerd.io docker-compose-plugin \ + && echo "dokku dokku/hostname string $DOKKU_HOSTNAME" | debconf-set-selections \ && echo "dokku dokku/skip_key_file boolean $DOKKU_SKIP_KEY_FILE" | debconf-set-selections \ && echo "dokku dokku/vhost_enable boolean $DOKKU_VHOST_ENABLE" | debconf-set-selections \ && curl -sSL https://packagecloud.io/dokku/dokku/gpgkey | apt-key add - \ diff --git a/contrib/build-dokku.Dockerfile b/contrib/build-dokku.Dockerfile index 89c0042b81d..3de8a3178f7 100644 --- a/contrib/build-dokku.Dockerfile +++ b/contrib/build-dokku.Dockerfile @@ -7,8 +7,8 @@ RUN command -v fpm >/dev/null || sudo gem install fpm --no-ri --no-rdoc ARG GOLANG_VERSION -RUN wget -qO /tmp/go${GOLANG_VERSION}.linux-amd64.tar.gz https://storage.googleapis.com/golang/go${GOLANG_VERSION}.linux-amd64.tar.gz \ - && tar -C /usr/local -xzf /tmp/go${GOLANG_VERSION}.linux-amd64.tar.gz \ +RUN wget -qO /tmp/go${GOLANG_VERSION}.linux.tar.gz "https://storage.googleapis.com/golang/go${GOLANG_VERSION}.linux-$(dpkg --print-architecture).tar.gz" \ + && tar -C /usr/local -xzf /tmp/go${GOLANG_VERSION}.linux.tar.gz \ && cp /usr/local/go/bin/* /usr/local/bin ARG WORKDIR=/go/src/github.com/dokku/dokku diff --git a/debian/control b/debian/control index dd9f1f2ffd0..43a6e22d2a5 100644 --- a/debian/control +++ b/debian/control @@ -3,7 +3,7 @@ Version: 0.28.4 Section: web Priority: optional Architecture: amd64 -Depends: apache2-utils, locales, git, cpio, curl, man-db, netcat, sshcommand (>= 0.12.0), docker-engine-cs (>= 17.05.0) | docker-engine (>= 17.05.0) | docker-io (>= 17.05.0) | docker.io (>= 17.05.0) | docker-ce (>= 17.05.0) | docker-ee (>= 17.05.0) | moby-engine, docker-image-labeler (>= 0.2.2), lambda-builder, net-tools, netrc, software-properties-common, parallel, procfile-util (>= 0.11.0), python-software-properties | python3-software-properties, rsync, rsyslog, dos2unix, jq, unzip +Depends: apache2-utils, locales, git, cpio, curl, man-db, netcat, sshcommand (>= 0.12.0), docker-engine-cs (>= 17.05.0) | docker-engine (>= 17.05.0) | docker-io (>= 17.05.0) | docker.io (>= 17.05.0) | docker-ce (>= 17.05.0) | docker-ee (>= 17.05.0) | moby-engine, docker-compose-plugin | moby-compose, docker-image-labeler (>= 0.2.2), lambda-builder, net-tools, netrc, software-properties-common, parallel, procfile-util (>= 0.11.0), python-software-properties | python3-software-properties, rsync, rsyslog, dos2unix, jq, unzip Recommends: herokuish (>= 0.3.4), bash-completion, dokku-update, dokku-event-listener Pre-Depends: gliderlabs-sigil, nginx (>= 1.8.0) | openresty, dnsutils, cgroupfs-mount | cgroup-lite, plugn (>= 0.3.0), sudo, python3, debconf Maintainer: Jose Diaz-Gonzalez diff --git a/docs/networking/proxies/caddy.md b/docs/networking/proxies/caddy.md index 672aa93c259..0eaf00eb6ba 100644 --- a/docs/networking/proxies/caddy.md +++ b/docs/networking/proxies/caddy.md @@ -15,7 +15,7 @@ caddy:stop # Stops the caddy server ## Requirements -Using the `caddy` plugin integration requires the `docker-compose-plugin` for Docker. See [this document](https://docs.docker.com/compose/install/compose-plugin/) from the Docker documentation for more information on the installation process for the `docker-compose-plugin`. +Using the `caddy` plugin integration requires the `docker-compose-plugin` for Docker. See [this document](https://docs.docker.com/compose/install/) from the Docker documentation for more information on the installation process for the `docker-compose-plugin`. ## Usage diff --git a/docs/networking/proxies/traefik.md b/docs/networking/proxies/traefik.md index 0ee731bd862..486c0b29945 100644 --- a/docs/networking/proxies/traefik.md +++ b/docs/networking/proxies/traefik.md @@ -15,7 +15,7 @@ traefik:stop # Stops the traefik server ## Requirements -Using the `traefik` plugin integration requires the `docker-compose-plugin` for Docker. See [this document](https://docs.docker.com/compose/install/compose-plugin/) from the Docker documentation for more information on the installation process for the `docker-compose-plugin`. +Using the `traefik` plugin integration requires the `docker-compose-plugin` for Docker. See [this document](https://docs.docker.com/compose/install/) from the Docker documentation for more information on the installation process for the `docker-compose-plugin`. ## Usage diff --git a/plugins/caddy-vhosts/command-functions b/plugins/caddy-vhosts/command-functions index 9e4347da5af..d7409da1e91 100755 --- a/plugins/caddy-vhosts/command-functions +++ b/plugins/caddy-vhosts/command-functions @@ -108,6 +108,10 @@ cmd-caddy-show-config() { declare cmd="caddy:show-config" [[ "$1" == "$cmd" ]] && shift 1 + if ! fn-is-compose-installed; then + dokku_log_fail "Required docker compose plugin is not installed" + fi + local TMP_COMPOSE_FILE=$(mktemp "/tmp/dokku-${DOKKU_PID}-${FUNCNAME[0]}.XXXXXX") trap "rm -rf '$TMP_COMPOSE_FILE' >/dev/null" RETURN INT TERM EXIT @@ -120,6 +124,10 @@ cmd-caddy-start() { declare cmd="caddy:start" [[ "$1" == "$cmd" ]] && shift 1 + if ! fn-is-compose-installed; then + dokku_log_fail "Required docker compose plugin is not installed" + fi + local TMP_COMPOSE_FILE=$(mktemp "/tmp/dokku-${DOKKU_PID}-${FUNCNAME[0]}.XXXXXX") trap "rm -rf '$TMP_COMPOSE_FILE' >/dev/null" RETURN INT TERM EXIT @@ -132,6 +140,10 @@ cmd-caddy-stop() { declare cmd="caddy:start" [[ "$1" == "$cmd" ]] && shift 1 + if ! fn-is-compose-installed; then + dokku_log_fail "Required docker compose plugin is not installed" + fi + local TMP_COMPOSE_FILE=$(mktemp "/tmp/dokku-${DOKKU_PID}-${FUNCNAME[0]}.XXXXXX") trap "rm -rf '$TMP_COMPOSE_FILE' >/dev/null" RETURN INT TERM EXIT diff --git a/plugins/common/functions b/plugins/common/functions index e2abf8bbff2..1261774a65d 100755 --- a/plugins/common/functions +++ b/plugins/common/functions @@ -399,6 +399,18 @@ get_docker_version() { echo "$CLIENT_VERSION_STRING" } +fn-is-compose-installed() { + declare desc="check if the compose docker plugin is installed" + local COMPOSE_INSTALLED + COMPOSE_INSTALLED="$(docker info -f '{{range .ClientInfo.Plugins}}{{if eq .Name "compose"}}true{{end}}{{end}}')" + + if [[ "$COMPOSE_INSTALLED" == "true" ]]; then + return 0 + fi + + return 1 +} + is_number() { declare desc="returns 0 if input is a number" local NUMBER=$1 diff --git a/plugins/traefik-vhosts/command-functions b/plugins/traefik-vhosts/command-functions index 423256a5c16..1df4b90c832 100755 --- a/plugins/traefik-vhosts/command-functions +++ b/plugins/traefik-vhosts/command-functions @@ -111,6 +111,10 @@ cmd-traefik-show-config() { declare cmd="traefik:show-config" [[ "$1" == "$cmd" ]] && shift 1 + if ! fn-is-compose-installed; then + dokku_log_fail "Required docker compose plugin is not installed" + fi + local TMP_COMPOSE_FILE=$(mktemp "/tmp/dokku-${DOKKU_PID}-${FUNCNAME[0]}.XXXXXX") trap "rm -rf '$TMP_COMPOSE_FILE' >/dev/null" RETURN INT TERM EXIT @@ -123,6 +127,10 @@ cmd-traefik-start() { declare cmd="traefik:start" [[ "$1" == "$cmd" ]] && shift 1 + if ! fn-is-compose-installed; then + dokku_log_fail "Required docker compose plugin is not installed" + fi + local TMP_COMPOSE_FILE=$(mktemp "/tmp/dokku-${DOKKU_PID}-${FUNCNAME[0]}.XXXXXX") trap "rm -rf '$TMP_COMPOSE_FILE' >/dev/null" RETURN INT TERM EXIT @@ -137,6 +145,10 @@ cmd-traefik-stop() { declare cmd="traefik:start" [[ "$1" == "$cmd" ]] && shift 1 + if ! fn-is-compose-installed; then + dokku_log_fail "Required docker compose plugin is not installed" + fi + local TMP_COMPOSE_FILE=$(mktemp "/tmp/dokku-${DOKKU_PID}-${FUNCNAME[0]}.XXXXXX") trap "rm -rf '$TMP_COMPOSE_FILE' >/dev/null" RETURN INT TERM EXIT