Getting Started with Docker
This guide will help you to run the spryker script on Linux, MacOS and Windows.
When working with Windows, use absolute paths while running commands. For example: mkdir /d/spryker && cd $_ or mkdir /c/Users/spryker && cd $_.
-
Open a terminal.
In case you are going to run the script on Windows, open Ubuntu (Learn about it here).
- Create a new folder and navigate into this folder.
- Depending on the desired shop type:
- Clone the B2C repository:
git clone https://github.com/spryker-shop/b2c-demo-shop.git -b 201907.0 --single-branch ./
- Clone the B2B repository:
git clone https://github.com/spryker-shop/b2b-demo-shop.git -b 201907.0 --single-branch ./
- Clone the B2C repository:
- Clone the docker repository:
git clone https://github.com/spryker/docker-sdk.git -b 1.2.2 --single-branch docker
Make sure docker 18.09.1+ and docker-compose 1.23+ are installed.
- Bootstrap local docker setup for demo:
docker/sdk bootstrap
- Once the job finishes, build and start the instance:
docker/sdk up
- Update the hosts file:
- Linux/MacOS:
echo "127.0.0.1 zed.de.demo-spryker.com yves.de.demo-spryker.com glue.de.demo-spryker.com zed.at.demo-spryker.com yves.at.demo-spryker.com glue.at.demo-spryker.com zed.us.demo-spryker.com yves.us.demo-spryker.com glue.us.demo-spryker.com mail.demo-spryker.com scheduler.demo-spryker.com queue.demo-spryker.com" | sudo tee -a /etc/hosts
If needed, add corresponding entries for other stores. For example, if you are going to have a US store, add the following entries: zed.us.demo-spryker.com glue.us.demo-spryker.com yves.us.demo-spryker
- Windows:
- Click Start → Search and type "Notepad".
- Right-click Notepad and select the Run as administrator option.
- In the User Account Control window click Yes to confirm the action.
- In the upper navigation panel, select File → Open.
- Put the following path into the address line: C:\Windows\System32\drivers\etc
- In the File name line, enter "hosts" and click Open.
The hosts file is opened in the drop-down. - Add the following line into the file:
127.0.0.1 zed.de.demo-spryker.com glue.de.demo-spryker.com yves.de.demo-spryker.com scheduler.demo-spryker.com mail.demo-spryker.com queue.demo-spryker.com
If needed, add corresponding entries for other stores. For example, if you are going to have a US store, add the following entries: zed.us.demo-spryker.com glue.us.demo-spryker.com yves.us.demo-spryker.com
- Click File → Save.
- Close the file.
Depending on the hardware performance, the first project launch can take up to 20 minutes.
-
Open a terminal.
In case you are going to run the script on Windows, open Ubuntu (Learn about it here).
- Create a new folder and navigate into this folder.
- Depending on the desired shop type:
- Clone the B2C repository:
git clone https://github.com/spryker-shop/b2c-demo-shop.git -b 201907.0 --single-branch ./
- Clone the B2B repository:
git clone https://github.com/spryker-shop/b2b-demo-shop.git -b 201907.0 --single-branch ./
- Clone the B2C repository:
- Clone the docker repository:
git clone https://github.com/spryker/docker-sdk.git -b 1.2.2 --single-branch docker
Make sure docker 18.09.1+ and docker-compose 1.23+ are installed.
- Bootstrap local docker setup:
docker/sdk bootstrap deploy.dev.yml
- Once the job finishes, build and start the instance:
docker/sdk up
- Update the hosts file:
- Linux/MacOS:
echo "127.0.0.1 zed.de.demo-spryker.com yves.de.demo-spryker.com glue.de.demo-spryker.com zed.at.demo-spryker.com yves.at.demo-spryker.com glue.at.demo-spryker.com zed.us.demo-spryker.com yves.us.demo-spryker.com glue.us.demo-spryker.com mail.demo-spryker.com scheduler.demo-spryker.com queue.demo-spryker.com" | sudo tee -a /etc/hosts
If needed, add corresponding entries for other stores. For example, if you are going to have a US store, add the following entries: zed.us.demo-spryker.com glue.us.demo-spryker.com yves.us.demo-spryker
- Windows:
- Click Start → Search and type "Notepad".
- Right-click Notepad and select the Run as administrator option.
- In the User Account Control window click Yes to confirm the action.
- In the upper navigation panel, select File → Open.
- Put the following path into the address line: C:\Windows\System32\drivers\etc
- In the File name line, enter "hosts" and click Open.
The hosts file is opened in the drop-down. - Add the following line into the file:
127.0.0.1 zed.de.demo-spryker.com glue.de.demo-spryker.com yves.de.demo-spryker.com scheduler.demo-spryker.com mail.demo-spryker.com queue.demo-spryker.com
If needed, add corresponding entries for other stores. For example, if you are going to have a US store, add the following entries: zed.us.demo-spryker.com glue.us.demo-spryker.com yves.us.demo-spryker.com
- Click File → Save.
- Close the file.
Depending on the hardware performance, the first project launch can take up to 20 minutes.
Learn more about development mode here.
-
Set the value of docker: ssl: enable: property to true in deploy.yml (or deploy.dev.yml if needed).
... docker: ssl: enabled: true ...
-
Apply the changes:
docker/sdk bootstrap deploy.yml
Make sure to use the name of the file from step 1.
-
Run the script to build and restart containers with SSL settings.
docker/sdk up
While running the script, you should see the following output:
Generating a RSA private key ....................................................+++++ ..............+++++ writing new private key to '/certs/spryker_ssl.key' ----- Signature ok subject=C = DE, ST = Berlin, L = Berlin, OU = Spryker, O = Spryker, CN = Spryker Getting CA Private Key Checking chain /certs/spryker_ssl.crt: OK
- In the meanwhile, if you haven't installed the CA certificate, take spryker.crt from /docker/deployment/default/ and follow the instructions.
-
Set the value of services:database:engine: property to mysql in deploy.yml (or deploy.dev.yml if needed).
... services: database: engine: mysql ...
- Apply the changes:
docker/sdk bootstrap deploy.yml
Make sure to use the name of the file from step 1.
-
Run the script to build and restart containers with MySQL settings:
docker/sdk up
- yves.de.demo-spryker.com, yves.at.demo-spryker.com, yves.us.demo-spryker.com - Shop UI (storefront)
- zed.de.demo-spryker.com, zed.at.demo-spryker.com, zed.us.demo-spryker.com - Back-office UI (administration interface)
- glue.de.demo-spryker.com, glue.at.demo-spryker.com, glue.us.demo-spryker.com - API endpoint
- scheduler.demo-spryker.com - Jenkins
- queue.demo-spryker.com - RabbitMQ UI (queue).
Use "spryker" as a username and "secret" as a password. They are defined in your deploy.yml.
- mail.demo-spryker.com - Mailhog UI (email catcher)
Run the docker/sdk help command to get the full and up-to-date list of commands.
The following commands are used to manage Docker-based Spryker applications:
- boot - Initialize docker setup for the project. Aliases: bootstrap
- build - Build Spryker containers.
- clean - Stop and remove all Spryker containers and volumes. Aliases: remove.
- clean-data - Remove all Spryker volumes including all storages.
- cli - Start a new container where you can run cli commands.
- cli <command> - Run a cli command, e.g. docker/sdk cli composer install.
- console - Run a Spryker console command, e.g. docker/sdk console code:test -vvv -g Acceptance.
- codecept - Start a new container where you can run Codeception commands in the test environment.
- code-checks - Run code checks.
- demo-data - Populate Spryker demo data. Aliases: demo
- down - Stop all Spryker containers. Aliases: stop.
- help - Show help page.
- jobs - Generate and start jobs.
- logs - Tail all application exception logs.
- pull - Pull external docker images.
- reset - Remove and build all Spryker containers and volumes.
- restart - Restart Spryker containers.
- run - Run Spryker containers. Aliases: start.
- testing - Start a new container where you can run cli commands in testing environment, e.g. codecept build.
- testing <command> - Run a cli command in testing environment, e.g. docker/sdk codecept codecept build.
- up - Build and run Spryker apps based on demo data.
- wait - Wait for requested services, e.g. docker/sdk wait database broker.
Arguments:
- -v - Enable verbose mode.
You can set the environment variable VERBOSE=1 instead of using this option.
- -x - Enable Xdebug.
You can set the environment variable SPRYKER_XDEBUG_ENABLE=1 instead of using this option.
- -t - Enable testing mode.
You can set environment variable SPRYKER_TESTING_ENABLE=1 instead of using this option.
See also:
- Spryker in Docker - Troubleshooting
- Debugging Setup in Docker
- Docker Installation Prerequisites
- HowTo - Install Self-Signed SSL Certificates
Last review date: Aug 06, 2019