Skip to content

dicksontung/docker-db2

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

docker-db2

A DB2 docker that automatically creates a sample db.

Getting started

You will need to have docker-compose installed.

To start the DB2 docker:

$ docker-compose up

Wait for the image to be downloaded, built and started.

Using the docker image

You can use your database viewer with the properties below to connect to the DB and check:

<url>jdbc:db2://localhost:50000/sample</url>
<user>db2inst1</user>
<password>password</password>

or you can use the command below to get to the container shell:

$ docker exec -it jdbc_db2_1 /bin/bash

Switch user to db2inst1:

$ su db2inst1

Connect to our sample database:

$ db2 connect to sample

Run the script you want:

$ db2 "select * from access_event"

Initialize docker with scripts

Put your create table script within /ibm-db2/db2.sql and the script will be run after database initialization

About

A DB2 docker that initializes a sample db

Topics

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages