{"id":23605,"date":"2021-09-15T04:53:28","date_gmt":"2021-09-15T04:53:28","guid":{"rendered":"https:\/\/www.devopsschool.com\/blog\/?p=23605"},"modified":"2025-07-12T05:41:42","modified_gmt":"2025-07-12T05:41:42","slug":"docker-lab-excercise-assignment-6-docker-linking","status":"publish","type":"post","link":"https:\/\/www.devopsschool.com\/blog\/docker-lab-excercise-assignment-6-docker-linking\/","title":{"rendered":"Docker Lab, Excercise &#038; Assignment &#8211; 6 &#8211; Docker Linking"},"content":{"rendered":"\n<p>Required Images.<\/p>\n\n\n<pre class=\"wp-block-code\"><span><code class=\"hljs\">$ docker pull mysql<\/code><\/span><\/pre>\n\n<pre class=\"wp-block-code\"><span><code class=\"hljs\">$ docker pull wordpress<\/code><\/span><\/pre>\n\n\n<p>Run the mySql Docker Container<\/p>\n\n\n<pre class=\"wp-block-code\"><span><code class=\"hljs\">$ docker run --name wpmysql -e MYSQL_ROOT_PASSWORD=password -d mysql:5.5<\/code><\/span><\/pre>\n\n<pre class=\"wp-block-code\"><span><code class=\"hljs\">$ docker ps<\/code><\/span><\/pre>\n\n\n<p>Run the wordpress Docker Container<\/p>\n\n\n<pre class=\"wp-block-code\"><span><code class=\"hljs\">$ docker run --name mywp --link wpmysql:mysql -P -d wordpress<\/code><\/span><\/pre>\n\n\n<p>Run the following commands and what kinds of environment variables its get exposed to wordpress after linking the docker.<\/p>\n\n\n<pre class=\"wp-block-code\"><span><code class=\"hljs\">$ docker run --rm --link wpmysql:mysql -P wordpress env<\/code><\/span><\/pre>\n\n\n<p>Now, Access the wordpress site and Lets add some pages and post into it and commit it and store with another name.<\/p>\n\n\n<div class=\"epyt-gallery\" data-currpage=\"1\" id=\"epyt_gallery_16458\"><iframe loading=\"lazy\"  id=\"_ytid_18926\"  width=\"760\" height=\"427\"  data-origwidth=\"760\" data-origheight=\"427\" src=\"https:\/\/www.youtube.com\/embed\/?enablejsapi=1&#038;autoplay=0&#038;cc_load_policy=0&#038;cc_lang_pref=&#038;iv_load_policy=1&#038;loop=0&#038;rel=1&#038;fs=1&#038;playsinline=0&#038;autohide=2&#038;theme=dark&#038;color=red&#038;controls=1&#038;disablekb=0&#038;\" class=\"__youtube_prefs__  no-lazyload\" title=\"YouTube player\"  data-epytgalleryid=\"epyt_gallery_16458\"  allow=\"fullscreen; accelerometer; autoplay; clipboard-write; encrypted-media; gyroscope; picture-in-picture; web-share\" referrerpolicy=\"strict-origin-when-cross-origin\" allowfullscreen data-no-lazy=\"1\" data-skipgform_ajax_framebjll=\"\"><\/iframe><div class=\"epyt-gallery-list\"><div>Sorry, there was a YouTube error.<\/div><\/div><\/div>","protected":false},"excerpt":{"rendered":"<p>Required Images. Run the mySql Docker Container Run the wordpress Docker Container Run the following commands and what kinds of environment variables its get exposed to wordpress after linking the&#8230; <\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_joinchat":[],"footnotes":""},"categories":[4862],"tags":[],"class_list":["post-23605","post","type-post","status-publish","format-standard","hentry","category-docker"],"_links":{"self":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/23605","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/comments?post=23605"}],"version-history":[{"count":2,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/23605\/revisions"}],"predecessor-version":[{"id":24183,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/posts\/23605\/revisions\/24183"}],"wp:attachment":[{"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/media?parent=23605"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/categories?post=23605"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.devopsschool.com\/blog\/wp-json\/wp\/v2\/tags?post=23605"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}