2. DB2 instance (db2inst1) running without any database on port 50000
10K+
Dockerfile linksexpc, latest (db2-db2inst1/expc/Dockerfile)11.1-ese, ese (db2-db2inst1/11.1/server_t/Dockerfile)10.5-ese (db2-db2inst1/10.5/server_t/Dockerfile)IBM DB2 is a family of database server products developed by IBM. These products all support the relational model, but in recent years some products have been extended to support object-relational features and non-relational structures, in particular XML.
Historically and unlike other database vendors, IBM produced a platform-specific DB2 product for each of its major operating systems. However, in the 1990s IBM changed track and produced a DB2 "common server" product, designed with a common code base to run on different platforms.

A DB2 instance is a running process that controls the security at the higher level, listens on a specific port, controls the databases it hosts, and many other operations related to database administration.
This image is part of a set of images to create your DB2 environment:
This is the stack of images:
+-----------------+
| 3) db2-sample | <-- Sample database (db2sampl)
+-----------------+
| 2) db2-db2inst1 | <-- Default instance created (db2inst1:50000)
+-----------------+
| 1) db2-install | <-- DB2 Express-C installed
+-----------------+
This image creates a DB2 instance based on the scripts that prepares the environment in the previous image. It uses the angoca/db2-install image that install Db2 and prepares the environment to create instances.
The container provides a created instance with the db2inst1 user and listening on port 50000 with home directory /home/db2inst1. These instructions are provided from the response file of the previous image and the whole process is performed from ./createInstance script. However, the name can be changed via arguments.
Once the instance is created, the container can be executed but it needs to be run in privileged mode because a DB2 instance requieres extra permissions to be run.
sudo docker run -i -t --privileged=true --name="db2inst1" -p 50000:50000 angoca/db2inst1
The name of the container will be db2inst1.
Depending on your configuration, you can try the following line in order to not use privileged mode but only the necessary elements for DB2:
sudo docker run -i -t --ipc="host" --cap-add IPC_LOCK --cap-add IPC_OWNER --name="db2inst1" -p 50000:50000 angoca/db2-instance
Please, check the Travis-CI execution to see how this image is build.
Once you have finished the configuration, you can leave the container running by typing:
Ctrl + P + Q
Now, you can create a database and start using DB2:
su - db2inst1
db2 create db mydb
If the db2 command is not accepted, it is because the db2profile is not loaded. You can reload the profile with the following command:
. ~db2inst1/sqllib/db2profile
Take a look that there is a space between the dot and the file name, this is because we are using the source command. Also, the db2inst1 is the supposed instance name.
Also, you can create the Sample database and play with a database already populated with data.
su - db2inst1
db2sampl
Note: For more information please take a look at the documentation of the db2-instance image in Docker Hub. It has more details about shared storage and ackowledgements to all the people that have helped to create these images.
The advantages to use this image instead of the other are:
db2inst1 or something like db2instX where X is a number.angoca repository. The image is not created on the fly. The basic images are created from Dockerfiles, the last one was published in the repository with the database already created. As part of the publish, a corresponding documentation is provided.If you have any problems with or questions about this image, please contact us through a GitHub issue.
You can also reach the mainteiner via Twitter @angoca.
You are invited to contribute new features, fixes, or updates, large or small; we are always thrilled to receive pull requests, and do our best to process them as fast as we can.
Before you start to code, we recommend discussing your plans through a GitHub issue, especially for more ambitious contributions. This gives other contributors a chance to point you in the right direction, give you feedback on your design, and help you find out if someone else is working on the same thing.
Content type
Image
Digest
Size
507.2 MB
Last updated
over 8 years ago
docker pull angoca/db2inst1