{"id":6138,"date":"2022-07-03T13:03:04","date_gmt":"2022-07-03T05:03:04","guid":{"rendered":"http:\/\/123.57.164.21\/?p=6138"},"modified":"2022-07-03T16:04:30","modified_gmt":"2022-07-03T08:04:30","slug":"installing-the-db2-community-edition-docker-image-on-macos-systems","status":"publish","type":"post","link":"https:\/\/92it.top\/?p=6138","title":{"rendered":"Installing the Db2 Community Edition Docker image on macOS systems"},"content":{"rendered":"\n<p>You can use the Db2\u00ae Community Edition to quickly develop, test, and build applications to work with your business&#8217;s operational and analytic workloads.<\/p>\n\n\n\n<p><strong>About this task<\/strong><\/p>\n\n\n\n<p>This procedure installs a Docker image of Db2 11.5.4 Community Edition on Apple macOS systems of version 10.10 or higher, equipped with Hyperkit. Hyperkit is a lightweight macOS virtualization solution built on top of the Hypervisor framework. The procedure assumes that you have Docker installed on a macOS system, using the steps outlined in <a href=\"https:\/\/www.ibm.com\/links?url=https%3A%2F%2Fdocs.docker.com%2Fdocker-for-mac%2Finstall%2F\" rel=\"noreferrer noopener\" target=\"_blank\">Install Docker Desktop on Mac<\/a>. The Db2 Community Edition Docker image has the following, preset limitations:<\/p>\n\n\n\n<ul id=\"t_install_db2CE_img__ul_b3s_rfc_cjb\"><li>Memory limit: 16GB<\/li><li>Core limit: 4 cores<\/li><li>Database size: 100GB<\/li><\/ul>\n\n\n\n<p><strong>Procedure<\/strong><\/p>\n\n\n\n<p>1.From the command line, create a new directory in which to store your database data:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">mkdir Docker<\/pre>\n\n\n\n<p>2.Go to this directory by entering the following command:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">cd Docker<\/pre>\n\n\n\n<p>3.Pull the Db2 Docker image from Docker Hub:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">docker pull ibmcom\/db2<\/pre>\n\n\n\n<p>4.Create an environment variables file, .env_list, for your Db2 Community Edition image:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">vi .env_list<\/pre>\n\n\n\n<p>5.Paste the following into the environment variables file:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">LICENSE=accept\nDB2INSTANCE=db2inst1\nDB2INST1_PASSWORD=password\nDBNAME=testdb\nBLU=false\nENABLE_ORACLE_COMPATIBILITY=false\nUPDATEAVAIL=NO\nTO_CREATE_SAMPLEDB=false\nREPODB=false\n\n\/\/ \u975e\u5e38\u91cd\u8981\uff01\uff01\uff01\uff01 \nIS_OSXFS=true\n\/\/ \u975e\u5e38\u91cd\u8981\uff01\uff01\uff01\uff01\nPERSISTENT_HOME=false\n\nHADR_ENABLED=false\nETCD_ENDPOINT=\nETCD_USERNAME=\nETCD_PASSWORD=<\/pre>\n\n\n\n<ul id=\"t_install_db2CE_img__ul_xcg_n4c_cjb\"><li>LICENSE accepts the terms and conditions of the Db2 software contained in this image<\/li><li>DB2INSTANCE specifies the Db2 instance name<\/li><li>DB2INST1_PASSWORD specifies the password of the Db2 instance<\/li><li>DBNAME creates an initial database with the name provided (leave empty if no database is needed)<\/li><li>BLU sets BLU Acceleration for the Db2 instance to enabled (<strong>true<\/strong>) or disabled (<strong>false<\/strong>)<\/li><li>ENABLE_ORACLE_COMPATIBILITY sets Oracle compatibility on the instance to enabled (<strong>true<\/strong>) or disabled (<strong>false<\/strong>)<\/li><li>UPDATEAVAIL can be set to <strong>YES<\/strong> if there is an existing instance running a new container with a higher Db2 level.<\/li><li>TO_CREATE_SAMPLEDB creates a sample (pre-populated) database (<strong>true<\/strong>)<\/li><li>REPODB creates a Data Server Manager repository database (<strong>true<\/strong>)<\/li><li>IS_OSXFS identifies the operating system as macOS (<strong>true<\/strong>)<\/li><li>PERSISTENT_HOME is set to <strong>true<\/strong> by default and should only specified as <strong>false<\/strong> when running Docker for Windows<\/li><li>HADR_ENABLED configures Db2 HADR for the instance (<strong>true<\/strong>). The following three environment variables depend on HADR_ENABLED being set to <strong>true<\/strong>:<ul><li>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 <strong>true<\/strong><\/li><li>ETCD_USERNAME specifies the username credential for ETCD. If left empty, it will use your Db2 instance<\/li><li>ETCD_PASSWORD specifies the password credential for ETCD. If left empty, it will use your Db2 instance password<\/li><\/ul><\/li><\/ul>\n\n\n\n<p>6.Save the file by pressing ESCAPE (ESC), and entering:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">:wq!<\/pre>\n\n\n\n<p>7.Enter and run the following command to enter the Docker container:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">docker run -h db2server --name db2server --restart=always --detach --privileged=true \n-p 50000:50000 --env-file .env_list -v \/Users\/&lt;username>\/Docker:\/database ibmcom\/db2<\/pre>\n\n\n\n<ul><li><code>-h<\/code> assigns the name db2server to the Docker container.<\/li><li><code>-p<\/code> specifies the port numbers to use.<\/li><li><code>--privileged<\/code> starts the container in privileged mode.<\/li><li><code>-v<\/code> defines the volume used for the Db2 Docker image.<\/li><\/ul>\n\n\n\n<p>8.Enter the following command to access the running Db2 instance within your Docker container:<\/p>\n\n\n\n<pre class=\"EnlighterJSRAW\" data-enlighter-language=\"generic\" data-enlighter-theme=\"\" data-enlighter-highlight=\"\" data-enlighter-linenumbers=\"\" data-enlighter-lineoffset=\"\" data-enlighter-title=\"\" data-enlighter-group=\"\">docker exec -ti db2server bash -c \"su \u2013 db2inst1\"<\/pre>\n\n\n\n<p>where <var>db2inst1<\/var> is the value associated with the <var>DB2INSTANCE<\/var> variable in your .env_list file.<\/p>\n\n\n\n<p>9.You can now create a Db2 database within the active instance.<\/p>\n","protected":false},"excerpt":{"rendered":"<p>You can use the Db2\u00ae Community Edition to quickly devel [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[20,23],"tags":[],"_links":{"self":[{"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts\/6138"}],"collection":[{"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=6138"}],"version-history":[{"count":4,"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts\/6138\/revisions"}],"predecessor-version":[{"id":6142,"href":"https:\/\/92it.top\/index.php?rest_route=\/wp\/v2\/posts\/6138\/revisions\/6142"}],"wp:attachment":[{"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=6138"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Fcategories&post=6138"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/92it.top\/index.php?rest_route=%2Fwp%2Fv2%2Ftags&post=6138"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}