-
Notifications
You must be signed in to change notification settings - Fork 4
jekyll docker local
This tutorial is about launching a local Jekyll website using Docker on a Linux operating system. For other operating systems, see how to install Docker and Docker Compose yourself and you can continue from Step 3.
- Linux with min. kernel version 3.10
docker
docker-compose
git
- Recommended:
vscodium
Installing Docker on a Linux operating system is very simple. Here in this tutorial we will customize the package sources and use the official ones of Docker to really get the latest version of Docker.
First, update your existing list of packages:
sudo apt update
Next, install a few prerequisite packages which let apt use packages over HTTPS:
sudo apt install apt-transport-https ca-certificates curl software-properties-common
Then add the GPG key for the official Docker repository to your system:
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add -
Add the Docker repository to APT sources:
sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu bionic stable"
Next, update the package database with the Docker packages from the newly added repo:
sudo apt update
Make sure you are about to install from the Docker repo instead of the default Ubuntu repo:
apt-cache policy docker-ce
You’ll see output like this, although the version number for Docker may be different:
docker-ce:
Installed: (none)
Candidate: 18.03.1~ce~3-0~ubuntu
Version table:
18.03.1~ce~3-0~ubuntu 500
500 https://download.docker.com/linux/ubuntu bionic/stable amd64 Packages
Now you can install docker
sudo apt-get install docker-ce docker-ce-cli containerd.io
To create the docker group and add your user:
Create the docker group.
sudo groupadd docker
Add your user to the docker group.
sudo usermod -aG docker $USER
Log out and log back in so that your group membership is re-evaluated.
Although you can install Docker Compose from the official Ubuntu repositories, it is several minor versions behind the latest release, so you’ll install Docker Compose from Docker’s GitHub repository.
Check the current release and if necessary, update it in the command below:
mkdir -p ~/.docker/cli-plugins/
curl -SL https://github.com/docker/compose/releases/download/v2.2.3/docker-compose-linux-x86_64 -o ~/.docker/cli-plugins/docker-compose
Next set the permissions:
chmod +x ~/.docker/cli-plugins/docker-compose
sudo chown $USER /var/run/docker.sock
Then you’ll verify that the installation was successful by checking the version:
docker compose version
since v.2.x the command is
docker compose
in older versions you have to usedocker-compose
.
This will print out the version you installed:
Output
Docker Compose version v2.2.3
Now that you have Docker Compose installed, you’re ready to run a “Hello World” example.
Now everything is prepared and it is time to check out the wanted repository. In this example, we check out the official website of #ASKnet Community and launch it locally.
Please go to your folder where do want to put the copy of the repository.
To do this, enter the following command in the terminal to check out the repository:
git clone https://github.com/ASKnetCommunity/ASKnet.Community.git
Next, switch to the project directory and launch the website.
cd ASKnet.Community
docker-compose up
and voila the website can be accessed via https://localhost:4000.
To exit the website again, the following key combination must be pressed on the keyboard: ctrl + c