SAP HANA on docker

Running SAP HANA on Windows in Docker on your own computer

There used to be a time when you needed to be a SAP Basis professional with a lot of knowledge of systems and SAP itself to be able to set-up a working SAP system. With the rising popularity of containerizing applications, it has become common for developers to set up their own personal (local) application servers for development and testing.

SAP has taken noticed and has started releasing some preconfigured container images which you can get up & running in a matter of minutes. exciting times!!

Prerequisites

  • At least 16GB of RAM memory
  • A Windows machine with Docker
  • (optional – best performance) WSL 2
  • 5-10 minutes of your time

Running SAP HANA

first let’s create a folder for our HANA config and storage:

1. Create a new folder. Ours will be C:/docker/hana/

2. Create a new file in this directory called docker-compose.yml and open it in your favorite text editor

3. Copy below configuration in the text file and save it

version: '3.8'

services:
      
  INSTANCE:
    image: store/saplabs/hanaexpress:2.00.045.00.20200121.1
    restart: on-failure
    ports:
      - 39013:39013
      - 39017:39017
      - 39041-39045:39041-39045 
      - 1128-1129:1128-1129 
      - 59013-59014:59013-59014
    command: "--passwords-url file:///hana/mounts/pw.json --agree-to-sap-license"
    volumes:
      - /c/docker/hana/data/:/hana/mounts

some explanation on the configuration in the file:

  • Services: -> defines the docker containers we will spin up – in our case we will only spin up the container “INSTANCE”
  • INSTANCE: -> the name of our docker container
    • Image: –> which pre-build image to take, we will take the official HANA image from the docker hub
    • ports: –> map the ports of the container to ports of the host in the format <host port [range]>:<container port [range]>.
    • command: -> a command which should be execute in the container when it is started. for us, this will be pointing to:
      • a password file for initializing the password for the HANA system user
      • agreeing to all licenses
    • volumes: -> link a directory on the host to a directory inside the container. this we can use to transfer data between host <-> container

4. create a new directory in C:\docker\hana called “data

5. create a new file called pw.json in C:\docker\hana\data and open it in your favorite text editor

6. enter below text in the pw.json file. This will be the password for the SYSTEM user of HANA

{
"master_password" : "Password1!"
}

7. open op a Command Prompt / Powershell and navigate to the location of the docker-compose.yml file (C:\docker\hana)

cd C:\docker\hana\

8. execute docker-compose up

docker-compose up

9. the HANA instance will now be downloaded and installed. this process might take a while (10 – 20 minutes)

Start of docker-compose
final output when HANA is ready

Congrats! you now have a running instance. now let’s connect to it.

10. open up HANA Studio / Eclipse with HANA tools. If you don’t have either installed, you can find a how-to here

11. switch to HANA view: window -> perspective -> open perspective -> other -> SAP HANA Development

12. add a new server

13. under hostname fill out:
Host Name -> localhost
Instance -> 90
[X] Multiple containers
[X] System database
description (optional) -> HANA server


14. as username enter SYSTEM and the password you choose in the pw.json file (Password1!) and press Finish

You have now connected successfully to you containerized HANA instance!

you can right click on the connection -> configuration and monitoring -> open Administration to check the details of your instance.

Final words

In this how-to we’ve learned how to spin up a containerized instance of SAP HANA and how to connect to it.

some remarks:

Leave a Reply

Your email address will not be published. Required fields are marked *