Background:
Docker is a subset of the bigger Moby Project, created in order to run multiple virtual machines via container system.
"It is a software framework for building, running, and managing containers on servers and the cloud."- Opensource.com
What is a container?
If you have any experience in web development, you would be familiar with the concept of servers. Traditionally, servers have been hardware made to allow people to connect to websites. However, this system had its own flaws. Hardware dependency had to be reduced so the concept of containers was given. Containers are software based servers. They provide an added benefit since they are a hybrid of the relatively faster Linux OS and a hyper-localized runtime environment.
How to run your first Shopware shop on Docker?
Running your demo-store (or Demo-shop) on docker is quite easy. Let us show you how to perform this task step by step:
My Setup:
For this tutorial, I will be using:
1. Windows 10 pro
2. Docker Desktop
3. Git Bash
Pre- Requisites:
In order to follow through this tutorial, you are expected to have the following stuff done:
1. Install docker for windows
2. Install git and git bash
Step 1: Open Git Bash
In the folder where you want your shopware files to be stored, right click and click on "Git Bash Here" option:
Step 2: Check if docker is installed
Just like any other software, the simplest way to check whether your docker is installed it to check its version through the version command. In your git bash, type the following command:
docker --version
Step 3: Run command to build shop
Now that you have your docker version, its time to run the final command. I will be showing a breakdown of this command so that you may customize it as per your need. The command is:
"docker run --rm -p 80:80 dockware/dev:latest"
In this command, some parts are fixed and others can be changed as per your need.
1. docker run: This one is mandatory to run any docker container via git bash.
2. --rm: This is to allow a fresh start. This part will remove all previous containers working for this.
3. -p: This is mandatory to link the port of your local system to the port of the docker container.
4. 80:80: These two are default ports and you can change them as per your available ports. The first (one before colon) is your host port (or ip) which is basically the port of your local system. The one after colon is the port of your docker container.
5. dockware/dev:latest: This part is mandatory to define the version of shopware you want to run. In this case, we want to run the lastest shopware. however, if you want to run some other version, just replace the "latest" with the respective version. For example: docker run --rm 300:80 dockware/dev:6.3.4.3
*Note: This method is good when you want to run shopware for the first time. If you want to re-run it after doing it once, just open docker-desktop and start the relevant container:
Step 4: Check localhost
Open localhost (with the relevant port, if needed). If everything went fine and the container shows running, you should be able to see your first shopware shop with the title Demostore. Just make sure you wait for a while after running the command since building a container (or even running an already built container) might take some time. Your display should be something like this:
Comments
Post a Comment