Dockerfile for SAP NetWeaver ABAP 7.5x Developer Edition

Published by Tobias Hofmann on

3 min read

This blog will help you to run your own SAP NetWeaver 7.51 ABAP instance inside a Docker container. This work was inspired by the Dockerfile created by Gregor Wolf and hosted at bitbucket.

The difference is that in Gregor’s version you download the NW ABAP installation files and when the container is build, you go manually through the installation. My Dockerfile assumes that you have downloaded the NW 7.51 ABAP installation files already and will automate the installation. Once you have downloaded the installation files from SAP you can make them locally available and create new Docker images / containers based on these, without having to download almost 16 GB again. And the installation script will run without prompting for user input.

Another differentiation is that you can “easily” change the Dockerfile to install NetWeaver 7.50 of the developer edition.

Pre-requisites

To be able to run the Dockerfile, you need

  • Docker installed
  • Downloaded and extracted installation files of SAP NW ABAP Developer Edition
  • Internet connection

Installation

1 Get the Dockerfile

From my GitHub repository, you can find a Dockerfile that helps you to create a Docker image and container that will install your downloaded NetWeaver version. All you need is the Dockerfile, so a simple download is sufficient. You can also download the file by cloning the GitHub repository: https://github.com/tobiashofmann/sap-nw-abap-docker

2. Download SAP NetWeaver DE installation files

Download your version of SAP NetWeaver ABAP 7.5x Developer Edition from SAP. The files are compressed (RAR).

  1. Un-compress them into a folder named NW751. The folder must be at the same location where your Dockerfile is.
  2. Build the Docker image

Build the Docker image

Command:

docker build -t nwabap .

Sample output

After the build is finished, the last line you should see is

Successfully tagged nwabap:latest

To see the ID and name of the newly created image, run the following command:

docker images

Sample output

The command lists the ID, tag and size of the image. As you can see, it’s a 15 GB Docker image. Using this image, you can start a container and install NW ABAP 7.51 DE inside the container.

Create container from image

You can now create a container from the image. You’ll have to connect to the container and run the installation script run.sh. The file was created during docker build. It will run SAP’s install.sh and fill in the input automatically.

docker run -P -h vhcalnplci --name nwabap751 -it nwabap:latest /bin/bash

This will start the container and log you in. What you’ll get is the bash shell.

bash-4.3#

In case you have Kitematic installed, you can see the running container listed.

The container configuration for the ports is also visible there. The ports are automatically mapped by Docker. The message server port 3200 is accessible through localhost:32771, and the HTTP port 8000 through localhost:32769. This mapping can be changed either inside Kitematic or when the container is started on the command shell.

Run ls to see the content of the current directory. You can see the install.sh file from SAP (feel free to start the installation manually) and the run.sh script that will automate the installation.

Start installation

Run the script run.sh to install SAP NetWeaver ABAP 7.51. The script will enter all information requested by install.sh automatically. The installation will take some time, +/- 20 minutes.

./run.sh

Sample output

[…]

[…]

The installation worked when the script ends and you can see the output:

Installation of NPL successful

 

 

Let the world know
Categories: BasisSAP

Tobias Hofmann

Doing stuff with SAP since 1998. Open, web, UX, cloud. I am not a Basis guy, but very knowledgeable about Basis stuff, as it's the foundation of everything I do (DevOps). Performance is king, and unit tests is something I actually do. Developing HTML5 apps when HTML5 wasn't around. HCP/SCP user since 2012, NetWeaver since 2002, ABAP since 1998.

28 Comments

Jakob Kjaer · September 25, 2017 at 17:44

Hi Gregor.
I am using the docker file and it works great. Lovely way to easily get tour hand on a dev sap system.
However I get the daemon dump mentioned in the issues in github. After you’ve created the image, is it then too late to add the daemon service?

    Jakob Kjaer · September 25, 2017 at 17:44

    Whoops I mean Tobias. Sorry!

    Tobias Hofmann · September 26, 2017 at 04:17

    Hi Jakob,

    with daemon dump you mean the UUID daemon that causes the transactions to crash? In the Dockerfile the UUIDD service is started. A simple /usr/sbin/uuidd should start the service.

    RUN mkdir /run/uuidd && chown uuidd /var/run/uuidd && /usr/sbin/uuidd

Marcello Urbani · October 24, 2017 at 07:14

How can you connect a sapgui to port 32771?
Shouldn’t stay 3200-3299? Using a proxy looks silly

    Tobias Hofmann · November 3, 2017 at 06:26

    It may look silly, but this is how Docker works. If you do not specify the port mapping during container startup, Docker assigns a random port. The assigned port can be taken from Kitematic. If you do not want to use a random port, just specify one. Than you can use port 3200.

      Sam · November 8, 2017 at 16:56

      In Windows SAPGUI you specify the port with host name. in Java GUI you use connection string.

      Marcello Urbani · March 2, 2018 at 04:12

      my fault, I missed the bit about port mapping and thought I needed an external proxy on top of docker (which did sound silly 🙂 )

      Thank you!

        Marcello Urbani · March 2, 2018 at 04:18

        anyway, my problem was that standard SAPGUI and similar only works with ports 32xx, and the solution is obvious 🙂

Karthikreddy · January 11, 2018 at 13:23

Hi Tobias Hofmann,
Its a great blog.I followed your blog to install SAP WEBDISPATCHER in Docker.
Now the Docker Container is up and Webdispatcher instance is created but the webdispatcher is not starting,as dont have any backend system to be choose as Message server.
So,can I connect a SAP System from other other network to this my container? Or should I have to install SAP System on Docker and use it as a backend system, but it is going to use,huge memory.
Please suggest.

Thanks & Regards,
Karthik

    Tobias Hofmann · January 26, 2018 at 06:28

    For the WD to be able to connect to another docker container, you’ll have to take a look into Docker networking. Put both containers on the same network and check that the name you are using is working.

Luc Vanrobays · January 17, 2018 at 09:10

Hi Tobias,

great work really. I was up and running in less than 45 mins..
The natural question poping up into my mind: why don’t we have the SAPGui (windows)ported to docker, now that Microsoft pretends to be a full docker player ?
Funny isn’t it ?
But to start with this topic, we have https://github.com/thalesvb/docker-platingui where you will have to supplement your own version of SAPGUI for Linux (not Mac) because the one available in the NW751 developer package is exclusively for Mac and Windows; and even if the Mac version is similar, it is slightly different and I couldn’t tweak it to have it work for Linux.

Again, great job and many thanks,

Luc

Luc Vanrobays · January 21, 2018 at 10:30

Hi Tobias,

I am elaborating a little more with the nwabap751 docker image. But there is one major flaw in Docker architecture, if unioning of data layers is done inside the container. In between the below described snapshots,
1.we first installed the instance vhcalnplci, then created one abap, activated some sflighs demo.
Then commited the container, resulting size from 15.6 GB to 65.7 GB
2.created another abap and filled tvarv tables with some sizeless values. Commit will result in 111GB, therefore we tag the image and got rid of previous 65.7GB image.
docker history shows us that data snapshots have been layered inside the same image.

This is a n important topic when dealing Statefull container and Docker community it-self, has suggested various efforts, for example http://jasonwilder.com/blog/2014/08/19/squashing-docker-images/ or https://github.com/moby/moby/issues/332.

Finally, https://thenewstack.io/methods-dealing-container-storage/ explains some of the solutions.
As a quick developer work-around, we should isolate ASE database files outside of the container I guest.

Thanks for your pioneering effort along with Gregor.

$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
nwabap751 latest be21a4550106 1 hour ago 15.6 GB
localhost:5000/opensuse latest ecb6d0d596fc 11 days ago 109 MB
$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
nwabap751i latest b5bcaed57f13 1 hour ago 65.7 GB
nwabap751 latest be21a4550106 12 hours ago 15.6 GB
localhost:5000/opensuse latest ecb6d0d596fc 11 days ago 109 MB
$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
b43b755600e8 21 seconds ago 111 GB
nwabap751i latest b5bcaed57f13 10 hours ago 65.7 GB
nwabap751 latest be21a4550106 12 hours ago 15.6 GB
localhost:5000/opensuse latest ecb6d0d596fc 11 days ago 109 MB
$ docker tag b43b755600e8 nwabap751i
$ docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
nwabap751i latest b43b755600e8 49 seconds ago 111 GB
nwabap751 latest be21a4550106 12 hours ago 15.6 GB
localhost:5000/opensuse latest ecb6d0d596fc 11 days ago 109 MB

$ docker history nwabap751i:latest
IMAGE CREATED CREATED BY SIZE COMMENT
b43b755600e8 3 minutes ago /bin/bash 45.4 GB
b5bcaed57f13 10 hours ago /bin/bash 50.1 GB
be21a4550106 12 hours ago /bin/bash 655 MB
b95edf399c0e 12 hours ago /bin/sh -c chmod +x install.sh 12.8 kB
b11beac2adc6 12 hours ago /bin/sh -c #(nop) WORKDIR /tmp/NW751 0 B
383dbe56d5d1 12 hours ago /bin/sh -c #(nop) COPY dir:882982bed60c3fd… 14.8 GB
b18bb7c146bd 12 hours ago /bin/sh -c mkdir /run/uuidd && chown uuidd… 9 B
a99fca45725e 12 hours ago /bin/sh -c zypper –non-interactive instal… 112 MB
c8e1b9e92ce3 12 hours ago /bin/sh -c #(nop) LABEL de.itsfullofstars… 0 B
ba2899aa6c02 12 hours ago /bin/sh -c #(nop) LABEL de.itsfullofstars… 0 B
156648749b8f 12 hours ago /bin/sh -c #(nop) LABEL de.itsfullofstars… 0 B
ecb6d0d596fc 11 days ago /bin/sh -c #(nop) ADD file:a9420b7d1b93757… 109 MB
2 months ago /bin/sh -c #(nop) MAINTAINER SUSE Contain… 0 B

    Tobias Hofmann · January 26, 2018 at 06:40

    Yes, NW on Docker is not production ready. You just cannot take 15 year old program and put it on Docker and say: not it’s modern architecture. NW is heavy, it’s big, it’s not available by a package manager like yum or apt.

    The image is not optimized for NW too: no volumes, DB not separated. But to some degree it depends on what SAP provides. The dev edition installs all in one location. Good thing: this makes it easier to start.

Antonio Huete Jimenez · January 25, 2018 at 14:19

Hi,

As per SAP note 1122387, Docker containers are not officially supported by SAP.
I thought this would come handy for someone actually interested in using Docker for SAP products.

Regards,
Antonio Huete

    Tobias Hofmann · January 26, 2018 at 06:32

    Yes, SAP is not supporting Docker. But the NW Dev version used is not available for productive use. It’S a developer edition, and it comes handy to be able to start a NW version automatically on a laptop.

    Putting a real S4 or Business Suite in Docker, would be nice, but won’t meet the Docker use case.

dropwort · March 28, 2018 at 19:35

Hi,

I have a question. A normal developer AS Trial needs about 60GB of disk space. How is it possible, that your docker image only needs 20GB? I really don´t understand, what happens there.

And my second question is, if it is possible to shrink the size of a regular developer-VM the same way.

Regards
Andreas

    George Younan · May 4, 2018 at 21:28

    Hi Andreas,
    The image is created contains only the openSuse OS and the copied NetWeaver files. The installation runs within a docker container, which is about 65 GB. If you enter “docker system df”: this will list all space used by docker for images and containers.
    Regards,
    George

George Younan · May 4, 2018 at 21:34

Hi Tobias,
Thanks for your effort. i successfully installed NW on docker. After the installation was complete and i configured the system according to my needs I wanted to try backup and recovery of the my Netweaver. I commited my container creating a new image. When i build the new image and run the new container, the database fails to start and accordingly the dispatcher status is grey. Did you observe such behavior as well?
Best regards,
George

Patrick · August 28, 2018 at 23:53

Hello Tobias, please excuse my naive questions. Aren’t docker containers stateless instances that are completely lost when the instance is stopped? Would ‘t be a vagrant file more usefull?

Thanks for a short answer,
Patrick

    Tobias Hofmann · September 3, 2018 at 17:02

    Hi Patrick,

    containers are not completely stateless, the data you write in there will survive a start/stop. The data won’t survive when you start each time a new container from the image.

Jorge Sancho · September 18, 2018 at 21:05

Hi Tobias,
I’ve tried to execute the steps as you described, but it stops at buiding the docker image for AS ABAP 7.52 in step 7/15.
the las text show in console is:

—> e600eff620ea
Step 7/15 : COPY NW752 /tmp/NW752/
COPY failed: stat /var/lib/docker/tmp/docker-builder684995070/NW752: no such file or directory

C:NW752>

Could you help me?
I’m trying to build the image in a Win10 laptop

Wilson López · October 25, 2018 at 16:49

Hi everybody, I just did all the steps but my docker says its not able to find install.sh Any trick ?

    Tobias Hofmann · November 6, 2018 at 15:45

    Hi Wilson,

    when you cmd into Docker and do a ls, what do you see? When you copy the NW installation files, did you uncompress them before? Is a install.sh file in your local directory where you start the docker build command?

      Eduardo · February 26, 2019 at 15:08

      Hi Tobias
      I have the following issue, can you help me please?
      Step 9/16 : RUN chmod +x install.sh
      —> Running in 9048f92aabb2
      chmod: cannot access ‘install.sh’: No such file or directory
      The command ‘/bin/sh -c chmod +x install.sh’ returned a non-zero code: 1

Gastón Jareño · January 18, 2019 at 00:18

I’m newbie with dockers.
– Docker Desktop 2.0.0.0-win81 (29211), build 4271b9e, is running
– I uncompressed “SAP HANA Trial NW AS ABAP 752 SP01” in C:NW751
– I downloaded file “sap-nw-abap-docker-master.zip” to the same thirectory (I didn’t unzipped it)
– I run PowerShell as administrator. CD C:NW751 and run command “docker build -t nwabap .”

I got following message:
unable to prepare context: unable to evaluate symlinks in Dockerfile path: GetFileAttributesEx C:NW751Dockerfile: The system cannot find the file specified.

Any idea?
Thanks!

Eduardo Costella · February 26, 2019 at 15:12

Hi Tobias

I have the following issue, can you help me, please?

Step 9/16 : RUN chmod +x install.sh
—> Running in 9048f92aabb2
chmod: cannot access ‘install.sh’: No such file or directory
The command ‘/bin/sh -c chmod +x install.sh’ returned a non-zero code: 1

jbo vnd · November 17, 2019 at 01:12

Fabulous, what a website it is! This weblog gives valuable data to us, keep
it up.

Leave a Reply

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

This site uses Akismet to reduce spam. Learn how your comment data is processed.