├── .github └── workflows │ └── test.yml ├── LICENSE ├── README.md ├── latest ├── .hadolint.yaml ├── Dockerfile ├── container-systemd-autologin.conf └── plesk-cloning-set-password.conf ├── tests ├── Dockerfile ├── docker-compose.yml └── wait-for-plesk.sh └── windows ├── Dockerfile └── README.md /.github/workflows/test.yml: -------------------------------------------------------------------------------- 1 | # Copyright 1999-2024. WebPros International GmbH. 2 | name: test 3 | 4 | on: 5 | push: 6 | paths: 7 | - 'latest/**' 8 | - 'tests/**' 9 | pull_request: 10 | paths: 11 | - 'latest/**' 12 | - 'tests/**' 13 | 14 | jobs: 15 | test: 16 | runs-on: ubuntu-24.04 17 | steps: 18 | - uses: actions/checkout@v4 19 | - run: docker compose -f ./tests/docker-compose.yml run tests 20 | -------------------------------------------------------------------------------- /LICENSE: -------------------------------------------------------------------------------- 1 | Copyright 1999-2024. Plesk International GmbH. 2 | 3 | Licensed under the Apache License, Version 2.0 (the "License"); 4 | you may not use this file except in compliance with the License. 5 | You may obtain a copy of the License at 6 | 7 | http://www.apache.org/licenses/LICENSE-2.0 8 | 9 | Unless required by applicable law or agreed to in writing, software 10 | distributed under the License is distributed on an "AS IS" BASIS, 11 | WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 12 | See the License for the specific language governing permissions and 13 | limitations under the License. 14 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Dockerfiles for Plesk 2 | 3 | [![Test Status](https://github.com/plesk/docker/actions/workflows/test.yml/badge.svg)](https://github.com/plesk/docker/actions/workflows/test.yml) 4 | 5 | Dockerfiles for building Plesk images. 6 | 7 | # Ready to Use Images 8 | 9 | Ready to use images are published at [Docker Hub](https://hub.docker.com/r/plesk/plesk/). 10 | 11 | Create a container based on published image for evaluation purposes: 12 | 13 | docker run -d \ 14 | --tmpfs /tmp \ 15 | --tmpfs /run \ 16 | --tmpfs /run/lock \ 17 | -v /sys/fs/cgroup:/sys/fs/cgroup \ 18 | --cgroupns=host \ 19 | --cap-add SYS_ADMIN \ 20 | --security-opt apparmor=unconfined \ 21 | -p 8880:8880 \ 22 | plesk/plesk 23 | 24 | Use Docker host IP address and 8880 port for URL to open it in the browser. The following command can be used in the terminal: 25 | 26 | open http://localhost:8880 27 | 28 | Default login and password: `admin` / `changeme1Q**` 29 | 30 | Create a container with typical port mapping: 31 | 32 | docker run -d \ 33 | --tmpfs /tmp \ 34 | --tmpfs /run \ 35 | --tmpfs /run/lock \ 36 | -v /sys/fs/cgroup:/sys/fs/cgroup \ 37 | --cgroupns=host \ 38 | --cap-add SYS_ADMIN \ 39 | --security-opt apparmor=unconfined \ 40 | -p 80:80 \ 41 | -p 443:443 \ 42 | -p 8880:8880 \ 43 | -p 8443:8443 \ 44 | -p 8447:8447 \ 45 | plesk/plesk 46 | 47 | # How To Build And Test 48 | 49 | Here is an example on how to build the image manually: 50 | 51 | cd latest ; docker build --no-cache --build-arg "LICENSE=A00C00-KF1111-7W5V74-YCJQ36-G8EF47" -t plesk/plesk . 52 | 53 | Create a container to test the image: 54 | 55 | docker run -d \ 56 | --tmpfs /tmp \ 57 | --tmpfs /run \ 58 | --tmpfs /run/lock \ 59 | -v /sys/fs/cgroup:/sys/fs/cgroup \ 60 | --cgroupns=host \ 61 | --cap-add SYS_ADMIN \ 62 | --security-opt apparmor=unconfined \ 63 | -p 8880:8880 \ 64 | plesk/plesk 65 | -------------------------------------------------------------------------------- /latest/.hadolint.yaml: -------------------------------------------------------------------------------- 1 | ignored: 2 | - DL3001 3 | - DL3006 4 | - DL3008 5 | -------------------------------------------------------------------------------- /latest/Dockerfile: -------------------------------------------------------------------------------- 1 | # Plesk container with real systemd 2 | # To test it, run the container in foreground using the following command: 3 | # docker run -ti --rm --tmpfs /tmp --tmpfs /run --tmpfs /run/lock -v /sys/fs/cgroup:/sys/fs/cgroup --cgroupns=host --cap-add SYS_ADMIN --security-opt apparmor=unconfined -p 8443:8443 plesk/plesk 4 | # Stop it with 'halt' instead of Ctrl+D. 5 | 6 | ARG OS=ubuntu:22.04 7 | FROM $OS 8 | 9 | LABEL maintainer="plesk-dev-leads@plesk.com" 10 | 11 | ENV container=docker 12 | 13 | # allow services to start 14 | RUN sed -i -e 's/exit.*/exit 0/g' /usr/sbin/policy-rc.d 15 | 16 | RUN set -eux; \ 17 | export DEBIAN_FRONTEND=noninteractive; \ 18 | apt-get update; \ 19 | apt-get install -y --no-install-recommends \ 20 | wget \ 21 | tzdata \ 22 | python3 \ 23 | rsyslog \ 24 | systemd \ 25 | systemd-sysv \ 26 | ; \ 27 | rm -rf /var/lib/apt/lists/*; \ 28 | : 29 | 30 | # prepare fake systemctl used only during build 31 | ADD https://github.com/gdraheim/docker-systemctl-replacement/raw/v1.5.8066/files/docker/systemctl3.py /usr/bin/fake-systemctl 32 | RUN set -eux; \ 33 | sed -i \ 34 | -e '/^\s*logg.error("the ..include. syntax is deprecated. Use x.service.d. drop-in files!")$/d' \ 35 | -e '/Loaded:/ s/({filename}, {enabled})/({filename}; {enabled})/' \ 36 | -e '/^\s*def do_\(start\|stop\)_unit_from(/,/^\s*def / s/return False/return conf.name().endswith(".path")/' \ 37 | /usr/bin/fake-systemctl; \ 38 | chmod 755 /usr/bin/fake-systemctl; \ 39 | : 40 | 41 | ARG LICENSE 42 | ARG AI_SOURCE=http://autoinstall.plesk.com 43 | ARG AI_ARGS= 44 | ARG EXT_CATALOG=https://ext.plesk.com 45 | 46 | # Do not install: 47 | # - additional PHP versions as we don't need them 48 | # - majority of extensions (except wp-toolkit) as we don't need them 49 | ENV PLESK_DISABLE_HOSTNAME_CHECKING=1 50 | ENV PLESK_CONFIG__extensions__catalog__url=$EXT_CATALOG 51 | ENV PLESK_CONFIG__taskManager__enabled=0 52 | RUN set -eux; \ 53 | : Use fake systemctl during build; \ 54 | dpkg-divert --divert /bin/systemctl.real --rename --add /bin/systemctl; \ 55 | ln -snf /usr/bin/fake-systemctl /bin/systemctl; \ 56 | : Install Plesk; \ 57 | wget -nv -O /root/ai $AI_SOURCE/plesk-installer; \ 58 | bash /root/ai install plesk all \ 59 | --source $AI_SOURCE \ 60 | --ext-catalog-url $EXT_CATALOG \ 61 | --preset Recommended \ 62 | --without \ 63 | config-troubleshooter advisor letsencrypt git \ 64 | xovi imunifyav sslit repair-kit composer monitoring \ 65 | log-browser ssh-terminal site-import \ 66 | $AI_ARGS \ 67 | ; \ 68 | : Configure Plesk; \ 69 | printf "[extensions]\ncatalog.url=${EXT_CATALOG}\n" >> /usr/local/psa/admin/conf/panel.ini; \ 70 | printf "[taskManager]\nenabled=off\n" >> /usr/local/psa/admin/conf/panel.ini; \ 71 | echo DOCKER > /usr/local/psa/var/cloud_id; \ 72 | plesk bin license -i $LICENSE; \ 73 | plesk bin init_conf --init -email changeme@example.com -passwd "changeme1Q**" -allow-weak-passwords -hostname-not-required; \ 74 | plesk bin settings --set admin_info_not_required=true; \ 75 | plesk bin poweruser --off; \ 76 | plesk bin extension --install-url https://github.com/plesk/ext-default-login/releases/download/1.2-1/default-login-1.2-1.zip; \ 77 | plesk bin cloning -u -prepare-public-image true -reset-license false -reset-init-conf false -skip-update true; \ 78 | : Stop services and clean up; \ 79 | /usr/lib/plesk-9.0/psa_service stopall; \ 80 | plesk installer stop; \ 81 | rm -rf /var/lib/apt/lists/*; \ 82 | rm -rf /root/ai /root/parallels /var/cache/parallels_installer /*.inf3 /pool /PHP* /SITEBUILDER* /run/lock/lmlib/*; \ 83 | rm -f /usr/local/psa/admin/conf/panel.ini; \ 84 | : Switch to real systemctl; \ 85 | rm -f /bin/systemctl; \ 86 | dpkg-divert --rename --remove /bin/systemctl; \ 87 | : 88 | 89 | COPY container-systemd-autologin.conf /etc/systemd/system/console-getty.service.d/override.conf 90 | COPY plesk-cloning-set-password.conf /etc/systemd/system/plesk-cloning.service.d/password.conf 91 | 92 | # Running image with any other command will execute it as PID 1, rendering systemctl broken 93 | CMD ["/sbin/init"] 94 | 95 | STOPSIGNAL SIGRTMIN+3 96 | 97 | # Port to expose 98 | # 21 - ftp 99 | # 25 - smtp 100 | # 53 - dns 101 | # 80 - http 102 | # 110 - pop3 103 | # 143 - imaps 104 | # 443 - https 105 | # 3306 - mysql 106 | # 8880 - plesk via http 107 | # 8443 - plesk via https 108 | # 8447 - autoinstaller 109 | EXPOSE 21 80 443 8880 8443 8447 110 | 111 | # vim: ts=4 sts=4 sw=4 et : 112 | -------------------------------------------------------------------------------- /latest/container-systemd-autologin.conf: -------------------------------------------------------------------------------- 1 | # drop-in override for console-getty.service to enable autologin in containers with systemd init 2 | 3 | [Service] 4 | ExecStart= 5 | ExecStartPre=-/usr/bin/sed -i '/pam_loginuid.so/d' /etc/pam.d/login 6 | ExecStart=-/sbin/agetty --autologin root --noclear --keep-baud console 115200,38400,9600 xterm 7 | -------------------------------------------------------------------------------- /latest/plesk-cloning-set-password.conf: -------------------------------------------------------------------------------- 1 | [Service] 2 | ExecStopPost=/usr/sbin/plesk bin admin --set-admin-password -passwd "changeme1Q**" -allow-weak-passwords 3 | ExecStopPost=/usr/bin/touch /root/.container_started 4 | -------------------------------------------------------------------------------- /tests/Dockerfile: -------------------------------------------------------------------------------- 1 | FROM debian:bookworm 2 | 3 | RUN apt-get update \ 4 | && apt-get install -y curl 5 | -------------------------------------------------------------------------------- /tests/docker-compose.yml: -------------------------------------------------------------------------------- 1 | # Copyright 1999-2024. WebPros International GmbH. 2 | services: 3 | plesk: 4 | build: 5 | context: ../latest/ 6 | args: 7 | LICENSE: A00C00-KF1111-7W5V74-YCJQ36-G8EF47 8 | logging: 9 | driver: none 10 | ports: 11 | ["8443:8443"] 12 | tmpfs: 13 | - /tmp 14 | - /run 15 | - /run/lock 16 | volumes: 17 | - /sys/fs/cgroup:/sys/fs/cgroup 18 | cgroup: host 19 | tests: 20 | build: . 21 | depends_on: 22 | - plesk 23 | links: 24 | - plesk 25 | volumes: 26 | - .:/opt/tests/ 27 | command: /opt/tests/wait-for-plesk.sh 28 | -------------------------------------------------------------------------------- /tests/wait-for-plesk.sh: -------------------------------------------------------------------------------- 1 | #!/bin/bash 2 | ### Copyright 1999-2024. WebPros International GmbH. 3 | 4 | COUNTER=1 5 | 6 | while : ; do 7 | curl -ksL https://plesk:8443/ | grep "Plesk" > /dev/null 8 | if [ $? -eq 0 ]; then 9 | echo "Plesk was successfully initialized." 10 | exit 0 11 | fi 12 | echo "($COUNTER) Waiting for the Plesk initialization..." 13 | sleep 5 14 | COUNTER=$((COUNTER + 1)) 15 | if [ $COUNTER -eq 60 ]; then 16 | echo "Too long, interrupting..." 17 | exit 1 18 | fi 19 | done 20 | -------------------------------------------------------------------------------- /windows/Dockerfile: -------------------------------------------------------------------------------- 1 | # Plesk the latest available version container 2 | 3 | FROM mcr.microsoft.com/windows/servercore:ltsc2019 4 | 5 | LABEL maintainer="plesk-dev-leads@plesk.com" 6 | 7 | ARG LICENSE 8 | ARG AI_HOST=installer-win.plesk.com 9 | 10 | RUN powershell -Command \ 11 | wget https://$env:AI_HOST/plesk-installer.exe -OutFile C:\plesk-installer.exe ; \ 12 | \ 13 | C:\plesk-installer.exe install panel release \ 14 | --source https://$env:AI_HOST \ 15 | --preset Recommended \ 16 | --options "PLESK_INSTALLDIR=C:\Plesk" \ 17 | --options "PLESK_DATADIR=C:\PleskData" \ 18 | --options "PLESK_VHOSTSDIR=C:\PleskVhosts" \ 19 | --tries 9 ; \ 20 | \ 21 | Remove-Item C:\plesk-installer.exe ; \ 22 | Remove-Item -Recurse -Force C:\ProgramData\Plesk\Installer 23 | 24 | RUN powershell -Command Set-Content -Path 'C:\PleskData\var\cloud_id' -Value 'DOCKER' 25 | 26 | RUN powershell -Command \ 27 | C:\Plesk\bin\init_conf.exe \ 28 | --init \ 29 | -email changeme@example.com \ 30 | -passwd changeme1Q** \ 31 | -allow-weak-passwords \ 32 | -hostname-not-required ; \ 33 | \ 34 | C:\Plesk\bin\license.exe -i $env:LICENSE ; \ 35 | C:\Plesk\bin\settings.exe --set admin_info_not_required=true ; \ 36 | C:\Plesk\bin\settings.exe --set login_timeout=3600 ; \ 37 | C:\Plesk\bin\poweruser.exe --off 38 | 39 | ADD https://dotnetbinaries.blob.core.windows.net/servicemonitor/2.0.1.10/ServiceMonitor.exe C:/ServiceMonitor.exe 40 | 41 | # Port to expose 42 | # 21 - ftp 43 | # 25 - smtp 44 | # 53 - dns 45 | # 80 - http 46 | # 110 - pop3 47 | # 143 - imaps 48 | # 443 - https 49 | # 3306 - mysql 50 | # 8880 - plesk via http 51 | # 8443 - plesk via https 52 | # 8447 - autoinstaller 53 | EXPOSE 21 80 443 8880 8443 8447 54 | 55 | ENTRYPOINT ["C:\\ServiceMonitor.exe", "w3svc"] 56 | -------------------------------------------------------------------------------- /windows/README.md: -------------------------------------------------------------------------------- 1 | # Plesk for Windows Docker Image 2 | 3 | * [Introduction](#introduction) 4 | * [Requirements](#requirements) 5 | * [How To Use Plesk Image](#how-to-use-plesk-image) 6 | * [How To Build Docker Image](#how-to-build-docker-image) 7 | * [How To Use Plesk Image On AWS EC2](#how-to-use-plesk-image-on-aws-ec2) 8 | 9 | # Introduction 10 | 11 | The directory contains a Dockerfile, which helps you to build an image with Plesk for Windows product. 12 | 13 | Plesk for Windows as a Docker container is an experimental project. Please use it only for evaluation and testing purposes at your own risk. 14 | 15 | # Requirements 16 | 17 | * Building an image for Windows must be performed on a server with Windows Server 2019 installed. 18 | * The OS version of the host system and the image version of Windows Server 2019 must be identical to run a container or build a new local image. 19 | * Otherwise, the build procedure or the launch of the container may fail (in particular, there can be a problem with Microsoft Visual C++ Redistributable installation). 20 | 21 | In order to fix it, you need to make sure that the versions match: 22 | 23 | cmd.exe /S /C ver 24 | 25 | Microsoft Windows [Version 10.0.17763.1697] 26 | 27 | To check the version of the base OS image, use the following link: [https://hub.docker.com/\_/microsoft-windows-servercore](https://hub.docker.com/_/microsoft-windows-servercore) 28 | 29 | | Tags | Architecture | Dockerfile | OsVersion | CreatedTime | LastUpdatedTime | 30 | | ---------|:------------:|:-------------:|:---------------:|:-------------------:|:-------------------:| 31 | | ltsc2019 | multiarch | No Dockerfile | 10.0.17763.1697 | 10/03/2018 20:30:05 | 01/12/2021 18:03:09 | 32 | 33 | If the OS version is outdated, you need to install all the latest updates. 34 | 35 | # How To Use Plesk Image 36 | 37 | To create a container based on published image, run the command: 38 | 39 | docker run -d -p 8880:8880 --name plesk plesk/plesk-windows 40 | 41 | Use Docker host IP address and 8880 port for URL to open it in the browser. The following command can be used in the terminal: 42 | 43 | Start-Process "http://localhost:8880" 44 | 45 | # How To Build Docker Image 46 | 47 | You can start the process of building Docker image with the following command: 48 | 49 | docker build --no-cache --build-arg "LICENSE=A00C00-KF1111-7W5V74-YCJQ36-G8EF47" -t plesk/plesk-windows . 50 | 51 | # How To Use Plesk Image On AWS EC2 52 | 53 | * Choose an Amazon Machine Image for EC2 instance with name "Microsoft Windows Server 2019 Base with Containers". 54 | * Choose an Instance Type t2.large with 8GB RAM and 50-60GB storage size. 55 | 56 | After starting the instance, run the command: 57 | 58 | docker run -d -p 8880:8880 --name plesk plesk/plesk-windows 59 | --------------------------------------------------------------------------------