Install a containerized DB2 database with Docker and do the setup

Installing Docker

For Mac need to go to https://docs.docker.com/desktop/mac/install/ and follow the steps. For windows it can be installed from https://docs.docker.com/desktop/windows/install/

Click on Apple icon and “About This Mac”
Check the processor details as shown above

Installing DB2 from an image

The Db2 Community Edition Docker image has the following, preset limitations:

  • Memory limit: 16GB
  • Core limit: 4 cores
  • Database size: 100GB
Pulling the db2 image with Docker
The .env_list on mac
The .env_list on Windows
  • LICENSE accepts the terms and conditions of the Db2 software contained in this image
  • DB2INSTANCE specifies the Db2 instance name
  • DB2INST1_PASSWORD specifies the password of the Db2 instance
  • DBNAME creates an initial database with the name provided (leave empty if no database is needed)
  • BLU sets BLU Acceleration for the Db2 instance to enabled (true) or disabled (false)
  • ENABLE_ORACLE_COMPATIBILITY sets Oracle compatibility on the instance to enabled (true) or disabled (false)
  • UPDATEAVAIL can be set to YES if there is an existing instance running a new container with a higher Db2 level.
  • TO_CREATE_SAMPLEDB creates a sample (pre-populated) database (true)
  • REPODB creates a Data Server Manager repository database (true)
  • IS_OSXFS identifies the operating system as macOS (true)
  • PERSISTENT_HOME is set to true by default and should only specified as false when running Docker for Windows
  • HADR_ENABLED configures Db2 HADR for the instance (true). The following three environment variables depend on HADR_ENABLED being set to true:
  • ETCD_ENDPOINT specifies your own provided ETCD key-value store. Enter your endpoints with a comma (and no space) as the delimiter. This environment variable is required if HADR_ENABLED is set to true
  • ETCD_USERNAME specifies the username credential for ETCD. If left empty, it will use yourDb2 instance
  • ETCD_PASSWORD specifies the password credential for ETCD. If left empty, it will use yourDb2 instance password
Container on Mac
Container on Windows
DB2 database — “DB2DB”on Mac
DB2 database “IMSDB” on Windows
Selct the DB2 LUW connection
Check connectivity to database with DBeaver on Mac
Check connectivity to database with DBeaver on Windows
DB navigation with DBeaver on Mac and Windows
Schema creation with DBeaver
Table creation with DBeaver

--

--

Get the Medium app

A button that says 'Download on the App Store', and if clicked it will lead you to the iOS App store
A button that says 'Get it on, Google Play', and if clicked it will lead you to the Google Play store