Installation
Source : https://docs.docker.com/engine/install/
Ubuntu
OS requirements
To install Docker Engine, you need the 64-bit version of one of these Ubuntu versions:
- Ubuntu Oracular 24.10
- Ubuntu Noble 24.04 (LTS)
- Ubuntu Jammy 22.04 (LTS)
- Ubuntu Focal 20.04 (LTS)
Docker Engine for Ubuntu is compatible with x86_64 (or amd64), armhf, arm64, s390x, and ppc64le (ppc64el) architectures.
Uninstall old version
Before you can install Docker Engine, you need to uninstall any conflicting packages.
Your Linux distribution may provide unofficial Docker packages, which may conflict with the official packages provided by Docker. You must uninstall these packages before you install the official version of Docker Engine.
The unofficial packages to uninstall are:
- docker.io
- docker-compose
- docker-compose-v2
- docker-doc
- podman-docker
Run the following command to uninstall all conflicting packages:
for pkg in docker.io docker-doc docker-compose docker-compose-v2 podman-docker; do sudo apt-get remove $pkg; doneSetup the apt repository
# Add Docker's official GPG key:
sudo apt-get update
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
# Add the repository to Apt sources:
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "${UBUNTU_CODENAME:-$VERSION_CODENAME}") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get updateInstallation from the apt repository
Run the following command to install the latest version of docker from the apt repository
sudo apt-get install docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-pluginTo verify the docker engine was sucessfully installed, run the following command :
sudo docker run hello-worldThis command downloads a test image and runs it in a container. When the container runs, it prints a confirmation message and exits.
Mac
Install steps
-
Download the installer using the download buttons at the top of the page, or from the release notes.
-
Double-click Docker.dmg to open the installer, then drag the Docker icon to the Applications folder. By default, Docker Desktop is installed at /Applications/Docker.app.
-
Double-click Docker.app in the Applications folder to start Docker.
-
Select Accept to continue.
-
From the installation window, select either:
- Use recommended settings (Requires password). This lets Docker Desktop automatically set the necessary configuration settings.
- Use advanced settings. You can then set the location of the Docker CLI tools either in the system or user directory, enable the default Docker socket, and enable privileged port mapping. See Settings, for more information and how to set the location of the Docker CLI tools.
-
Select Finish. If you have applied any of the previous configurations that require a password in step 6, enter your password to confirm your choice.
Windows
Installation steps
-
Download the installer using the download button at the top of the page, or from the release notes.
-
Double-click Docker Desktop Installer.exe to run the installer. By default, Docker Desktop is installed at C:\Program Files\Docker\Docker.
-
When prompted, ensure the Use WSL 2 instead of Hyper-V option on the Configuration page is selected or not depending on your choice of backend.
-
On systems that support only one backend, Docker Desktop automatically selects the available option.
-
Follow the instructions on the installation wizard to authorize the installer and proceed with the installation.
-
When the installation is successful, select Close to complete the installation process.
NB : If your administrator account is different to your user account, you must add the user to the docker-users group
Docker and Docker Compose Locally
Make sure you have linked the ./compose/dev.yaml to the root of the project as docker-compose.yaml
Carefull not to have 2 compose files !!
ln -s ./compose/dev.yaml docker-compose.yamlMake sure you have linked the ./environments/.env.local to the root of the project as .env.local.
ln -s ./environments/.env.local.example .env.localMake sure to populate (and DO NOT commit) the secret values in .env.local :
GITHUB_TOKEN=ghp_FaKeToKeN123(add this one in both .env and .env.local)
On your local machine, add the necessary entries to /etc/hosts so the project routes correctly (you will need elevated privileges to do so) :
127.0.0.1 phpc.local.{app-name}.localhost # The application itself
127.0.0.1 login.{app-name}.localhost ## The loginFakerRun the setup script to install local ssl (https on your requests). Replace {app-name} with the name of your application :
./localSetup.sh -n {app-name}Change the Caddyfile (caddy config file) so the app-name matches whatever you inputed :
phpc.local.{app-name}.localhost { // CHANGE THIS TO A VALID APP NAME
[...]
}
login.{app-name}.localhost { // CHANGE THIS TO A VALID APP NAME
[...]
}Finally, make sure you have a valid .npmrc file with your github auth token.
Run
First, use the docker compose utility to build with the right .env file :
docker compose --env-file .env.local buildUse the docker compose utility to run the project locally :
docker compose --env-file .env.local upVisit https://login.{app-name}.localhost/login to avoid the login process. This will generate a currentUser token that’s only valid locally.
The app should be running and available on https://phpc.local.{app-name}.localhost
Disclaimer : Do note that while the link https://phpc.local.{app-name}.localhost contains phpc as the first word, it does not necessarily mean the tenant is phpc. On a local docker setup, alaways refer to the environment variable $CONFIG_TENANT to ensure you are not being mislead by the url name. (For example, your link might be phpc.local.{app-name}.localhost, while your application would be in the demo1 tenant)
Troubleshoot
-
Make sure you have access to the login-faker project. Link : https://github.com/PHPCreation/phpreaction-login-cas-faker
-
On ubuntu, if you’re running docker as root, the dependancies for login-faker fail to install. As a fix, add yourself to the docker group.
-
If you want to change the version of a dependency, you will have to re-build the containers. e.g. : Here is an example package.json :
{
"name": "example-app",
"dependencies": {
"@phpcreation/example-bundle": "1.0.2",
}
}After changing the @phpcreation/example-bundle version to 1.0.3, you must re-build :
docker compose --env-file .env.local build