<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Raquel Campuzano Godoy</title>
    <description>The latest articles on DEV Community by Raquel Campuzano Godoy (@raquelcampuzano).</description>
    <link>https://dev.to/raquelcampuzano</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F312967%2Fa84b4ad6-3513-45b7-bfdd-04c990caf59e.jpeg</url>
      <title>DEV Community: Raquel Campuzano Godoy</title>
      <link>https://dev.to/raquelcampuzano</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/raquelcampuzano"/>
    <language>en</language>
    <item>
      <title>Deploy a Custom WordPress Image on a Kubernetes Cluster Using Bitnami Helm Charts</title>
      <dc:creator>Raquel Campuzano Godoy</dc:creator>
      <pubDate>Wed, 29 Jan 2020 17:34:42 +0000</pubDate>
      <link>https://dev.to/raquelcampuzano/deploy-a-custom-wordpress-image-on-a-kubernetes-cluster-using-bitnami-helm-charts-2hmc</link>
      <guid>https://dev.to/raquelcampuzano/deploy-a-custom-wordpress-image-on-a-kubernetes-cluster-using-bitnami-helm-charts-2hmc</guid>
      <description>&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://docs.bitnami.com/tutorials/deploy-custom-wordpress-production-helm/" rel="noopener noreferrer"&gt;docs.bitnami.com&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;p&gt;&lt;a href="https://dev.to/raquelcampuzano/develop-locally-a-custom-wordpress-using-a-bitnami-docker-image-44ic"&gt;In the first part of this series&lt;/a&gt;, we have learned how to modify a Bitnami Docker WordPress image to include a custom plugin and a theme from the first run. &lt;/p&gt;

&lt;p&gt;The last step we performed was to push our image to Docker Hub for having it available to use and ready to deploy on a Kubernetes cluster. Let's continue moving our WordPress site to a production scenario!&lt;/p&gt;

&lt;h1&gt;
  
  
  Helm charts: Ready-To-Deploy Applications
&lt;/h1&gt;

&lt;p&gt;&lt;a href="http://helm.sh/" rel="noopener noreferrer"&gt;Helm charts&lt;/a&gt; are packages of pre-configured Kubernetes resources. A Helm chart describes how to manage a specific application on Kubernetes. &lt;/p&gt;

&lt;p&gt;For easy and fast deployment of any containerized application on Kubernetes, the use of Helm charts are a savvy choice. Each chart includes references (Docker-compatible) to the container images that contain the application code to be run.&lt;/p&gt;

&lt;p&gt;Based on a &lt;a href="https://dev.to/raquelcampuzano/develop-locally-a-custom-wordpress-using-a-bitnami-docker-image-44ic"&gt;custom WordPress container&lt;/a&gt;, this tutorial shows how to make the necessary tweaks in the &lt;a href="https://raw.githubusercontent.com/bitnami/charts/master/upstreamed/wordpress/values-production.yaml" rel="noopener noreferrer"&gt;Bitnami WordPress Helm chart's &lt;em&gt;values.production.yaml&lt;/em&gt;&lt;/a&gt; file to run your application in a production environment. &lt;/p&gt;

&lt;h1&gt;
  
  
  Set Up Prerequisites
&lt;/h1&gt;

&lt;p&gt;Before starting, make sure that you have:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A Docker environment &lt;a href="https://docs.docker.com/install/" rel="noopener noreferrer"&gt;installed and configured&lt;/a&gt;. &lt;/li&gt;
&lt;li&gt;
&lt;a href="https://dev.toDocker%20Hub%20account"&gt;A Docker Hub account&lt;/a&gt;. &lt;/li&gt;
&lt;li&gt;
&lt;a href="https://dev.to/raquelcampuzano/develop-locally-a-custom-wordpress-using-a-bitnami-docker-image-44ic"&gt;A custom WordPress container published&lt;/a&gt; in a container registry. &lt;/li&gt;
&lt;li&gt;A &lt;a href="https://docs.bitnami.com/kubernetes/" rel="noopener noreferrer"&gt;Kubernetes cluster running&lt;/a&gt; in the platform of your choice. &lt;/li&gt;
&lt;li&gt;The &lt;a href="https://docs.bitnami.com/kubernetes/get-started-kubernetes/#step-3-install-kubectl-command-line" rel="noopener noreferrer"&gt;kubectl command line (kubectl CLI)&lt;/a&gt; installed.&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://docs.bitnami.com/kubernetes/get-started-kubernetes/#step-4-install-helm" rel="noopener noreferrer"&gt;Helm v3.x&lt;/a&gt; installed.&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;In the next steps, remember to replace "DOCKER_USERNAME/my-custom-wordpress" with the username of your Docker account and the name of your image, respectively.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h1&gt;
  
  
  Step 1: Define Configuration Values for the Bitnami WordPress Helm Chart
&lt;/h1&gt;

&lt;p&gt;To begin the process, you need to obtain the &lt;em&gt;values-production.yaml&lt;/em&gt; file that Bitnami includes in its &lt;a href="https://raw.githubusercontent.com/bitnami/charts/master/upstreamed/wordpress/values-production.yaml" rel="noopener noreferrer"&gt;WordPress chart repository&lt;/a&gt; and edit it to use your custom image.&lt;/p&gt;

&lt;p&gt;1) Execute the following to download the &lt;em&gt;values-production.yaml&lt;/em&gt; file:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;curl &lt;span class="nt"&gt;-Lo&lt;/span&gt; values-production.yaml https://raw.githubusercontent.com/bitnami/charts/master/upstreamed/wordpress/values-production.yaml
~~~&lt;span class="o"&gt;{&lt;/span&gt;% endraw %&lt;span class="o"&gt;}&lt;/span&gt;

&lt;span class="o"&gt;&amp;gt;&lt;/span&gt; If your image is not stored &lt;span class="k"&gt;in &lt;/span&gt;a public repository, you must also specify the image registry name and your registry key secret name &lt;span class="k"&gt;in &lt;/span&gt;the &lt;span class="s2"&gt;"global"&lt;/span&gt; section of the &lt;span class="k"&gt;*&lt;/span&gt;values-production.yaml&lt;span class="k"&gt;*&lt;/span&gt; file. Otherwise, the cluster won&lt;span class="s1"&gt;'t be able to pull the image from your private repository. Check the [Kubernetes official documentation](https://kubernetes.io/docs/tasks/configure-pod-container/pull-image-private-registry/) to learn how to create a secret for a private Docker registry.

2) Open the *values-production.yaml* and update the values below to point to your custom container image: 

* image.registry
* image.repository
* image.tag{% raw %}

~~~yaml
## Bitnami WordPress image version
## ref: https://hub.docker.com/r/bitnami/wordpress/tags/
##
image:
  registry: docker.io
  repository: DOCKER_USERNAME/my-wordpress
  tag: 1.0
~~~

3) Review the remaining parameters to make sure that you have included any other customizations that your deployment will require such as enabling Ingress rules, using external services (databases) and so on.

# Step 2: Deploy Your Custom WordPress Image on Kubernetes Using the Bitnami WordPress Helm Chart

To simplify the process of deploying the custom WordPress image, we are going to use the Bitnami'&lt;/span&gt;s WordPress Helm chart which already has built-in support &lt;span class="k"&gt;for &lt;/span&gt;custom Docker images.

1&lt;span class="o"&gt;)&lt;/span&gt; Check that you can connect to your Kubernetes cluster.&lt;span class="o"&gt;{&lt;/span&gt;% raw %&lt;span class="o"&gt;}&lt;/span&gt;

~~~bash
kubectl cluster-info
~~~&lt;span class="o"&gt;{&lt;/span&gt;% endraw %&lt;span class="o"&gt;}&lt;/span&gt;

2&lt;span class="o"&gt;)&lt;/span&gt; To make Helm pull your custom image, execute the &lt;span class="k"&gt;*&lt;/span&gt;helm &lt;span class="nb"&gt;install&lt;/span&gt;&lt;span class="k"&gt;*&lt;/span&gt; &lt;span class="nb"&gt;command &lt;/span&gt;followed by the modified &lt;span class="k"&gt;*&lt;/span&gt;values-production.yaml&lt;span class="k"&gt;*&lt;/span&gt; as follows:&lt;span class="o"&gt;{&lt;/span&gt;% raw %&lt;span class="o"&gt;}&lt;/span&gt; 

~~~bash
helm repo add stable https://kubernetes-charts.storage.googleapis.com/
helm &lt;span class="nb"&gt;install &lt;/span&gt;my-wordpress stable/wordpress  &lt;span class="nt"&gt;-f&lt;/span&gt; values-production.yaml
~~~&lt;span class="o"&gt;{&lt;/span&gt;% endraw %&lt;span class="o"&gt;}&lt;/span&gt;

&lt;span class="o"&gt;![&lt;/span&gt;Creating pods]&lt;span class="o"&gt;(&lt;/span&gt;https://dev-to-uploads.s3.amazonaws.com/i/sh8i0d2ouvzinqcvw9l0.png&lt;span class="o"&gt;)&lt;/span&gt;

3&lt;span class="o"&gt;)&lt;/span&gt; Check the pod status:&lt;span class="o"&gt;{&lt;/span&gt;% raw %&lt;span class="o"&gt;}&lt;/span&gt;

~~~bash
kubectl get pods
~~~&lt;span class="o"&gt;{&lt;/span&gt;% endraw %&lt;span class="o"&gt;}&lt;/span&gt;

   You will get a list of running pods:

&lt;span class="o"&gt;![&lt;/span&gt;Get pods]&lt;span class="o"&gt;(&lt;/span&gt;https://dev-to-uploads.s3.amazonaws.com/i/7huprl80kr1hvbxn2pb2.png&lt;span class="o"&gt;)&lt;/span&gt;

4&lt;span class="o"&gt;)&lt;/span&gt; To obtain the application URL, &lt;span class="nb"&gt;wait &lt;/span&gt;&lt;span class="k"&gt;until &lt;/span&gt;the pods are running and &lt;span class="k"&gt;then &lt;/span&gt;run the commands shown &lt;span class="k"&gt;in &lt;/span&gt;the &lt;span class="s2"&gt;"Notes"&lt;/span&gt; section. 

5&lt;span class="o"&gt;)&lt;/span&gt; Browse to WordPress at the resulting service IP address. You should see your WordPress site with the custom theme that you have included &lt;span class="k"&gt;in &lt;/span&gt;your image already activated:

&lt;span class="o"&gt;![&lt;/span&gt;Theme activated]&lt;span class="o"&gt;(&lt;/span&gt;https://dev-to-uploads.s3.amazonaws.com/i/1hgavfwnwhi4zxtt17zy.png&lt;span class="o"&gt;)&lt;/span&gt;

6&lt;span class="o"&gt;)&lt;/span&gt; Log &lt;span class="k"&gt;in &lt;/span&gt;to WordPress with the credentials obtained from running the commands &lt;span class="k"&gt;in &lt;/span&gt;the &lt;span class="s2"&gt;"Notes"&lt;/span&gt; section of the chart deployment output. Navigate to the &lt;span class="s2"&gt;"Plugins"&lt;/span&gt; section and check that the plugin is also installed and activated:

&lt;span class="o"&gt;![&lt;/span&gt;Plugin activated]&lt;span class="o"&gt;(&lt;/span&gt;https://dev-to-uploads.s3.amazonaws.com/i/9riy0bduf4sthefael1q.png&lt;span class="o"&gt;)&lt;/span&gt;

&lt;span class="c"&gt;# Step 3: Update the Source Code and Re-Deploy the Application&lt;/span&gt;

As a developer you may want to introduce new implementations and features to your application. 

These are the typical steps you follow to release a new Docker image:

&lt;span class="k"&gt;*&lt;/span&gt; Change your application &lt;span class="nb"&gt;source &lt;/span&gt;code
&lt;span class="k"&gt;*&lt;/span&gt; Rebuild the image 
&lt;span class="k"&gt;*&lt;/span&gt; Republish the image &lt;span class="k"&gt;in &lt;/span&gt;your selected container registry

To &lt;span class="nb"&gt;complete &lt;/span&gt;the application update process and re-deploy your application on Kubernetes, follow these instructions:

1&lt;span class="o"&gt;)&lt;/span&gt; Remove the installed theme &lt;span class="k"&gt;in &lt;/span&gt;the WordPress image build &lt;span class="k"&gt;in &lt;/span&gt;the &lt;span class="o"&gt;[&lt;/span&gt;first guide of this series]&lt;span class="o"&gt;(&lt;/span&gt;https://dev.to/raquelcampuzano/develop-locally-a-custom-wordpress-using-a-bitnami-docker-image-44ic&lt;span class="o"&gt;)&lt;/span&gt;&lt;span class="nb"&gt;.&lt;/span&gt; 

To &lt;span class="k"&gt;do &lt;/span&gt;so, remove all lines that refer to it both &lt;span class="k"&gt;in &lt;/span&gt;these files: 

&lt;span class="k"&gt;*&lt;/span&gt; &lt;span class="k"&gt;*&lt;/span&gt;rootfs/download-extra.sh&lt;span class="k"&gt;*&lt;/span&gt; 
&lt;span class="k"&gt;*&lt;/span&gt; &lt;span class="k"&gt;*&lt;/span&gt;rootfs/app-entrypoint.sh&lt;span class="k"&gt;*&lt;/span&gt;

2&lt;span class="o"&gt;)&lt;/span&gt; Build and republish the new image:&lt;span class="o"&gt;{&lt;/span&gt;% raw %&lt;span class="o"&gt;}&lt;/span&gt;

~~~bash
docker build &lt;span class="nt"&gt;-t&lt;/span&gt; DOCKER_USERNAME/my-wordpress:2.0 &lt;span class="nb"&gt;.&lt;/span&gt;
docker push DOCKER_USERNAME/my-wordpress:2.0 
~~~&lt;span class="o"&gt;{&lt;/span&gt;% endraw %&lt;span class="o"&gt;}&lt;/span&gt;

3&lt;span class="o"&gt;)&lt;/span&gt; Update the Helm chart by executing the &lt;span class="nb"&gt;command &lt;/span&gt;below. It will upgrade the chart and &lt;span class="nb"&gt;install &lt;/span&gt;the latest version of your image:&lt;span class="o"&gt;{&lt;/span&gt;% raw %&lt;span class="o"&gt;}&lt;/span&gt;

~~~bash
helm upgrade my-wordpress stable/wordpress &lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="nt"&gt;-f&lt;/span&gt; values-production.yaml &lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="nt"&gt;--set&lt;/span&gt; image.tag&lt;span class="o"&gt;=&lt;/span&gt;2.0
&lt;span class="nt"&gt;--set&lt;/span&gt; &lt;span class="nv"&gt;wordpressPassword&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;kubectl get secret my-wordpress-wordpress &lt;span class="nt"&gt;-o&lt;/span&gt; &lt;span class="nv"&gt;jsonpath&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'{.data.wordpress-password}'&lt;/span&gt; | &lt;span class="nb"&gt;base64&lt;/span&gt; &lt;span class="nt"&gt;--decode&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt; &lt;span class="se"&gt;\&lt;/span&gt;
&lt;span class="nt"&gt;--set&lt;/span&gt; mariadb.db.password&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;&lt;span class="si"&gt;$(&lt;/span&gt;kubectl get secret my-wordpress-mariadb &lt;span class="nt"&gt;-o&lt;/span&gt; &lt;span class="nv"&gt;jsonpath&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;'{.data.mariadb-password}'&lt;/span&gt; | &lt;span class="nb"&gt;base64&lt;/span&gt; &lt;span class="nt"&gt;--decode&lt;/span&gt;&lt;span class="si"&gt;)&lt;/span&gt;&lt;span class="s2"&gt;"&lt;/span&gt;
~~~&lt;span class="o"&gt;{&lt;/span&gt;% endraw %&lt;span class="o"&gt;}&lt;/span&gt;

4&lt;span class="o"&gt;)&lt;/span&gt; Browse again to the application IP address. You should see your WordPress site with the default theme enabled.

&lt;span class="o"&gt;![&lt;/span&gt;WordPress default theme]&lt;span class="o"&gt;(&lt;/span&gt;https://dev-to-uploads.s3.amazonaws.com/i/qnlqpb3mwonvmlid5vuq.png&lt;span class="o"&gt;)&lt;/span&gt;

It is not magic! It is the power of Helm.

You have not only deployed your custom WordPress &lt;span class="k"&gt;in &lt;/span&gt;a production environment but also applied a change &lt;span class="k"&gt;in &lt;/span&gt;the application code and re-deployed your website with the updated configuration. 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

</description>
      <category>kubernetes</category>
      <category>docker</category>
      <category>devops</category>
      <category>wordpress</category>
    </item>
    <item>
      <title>Develop Locally A Custom WordPress Using A Bitnami Docker Image</title>
      <dc:creator>Raquel Campuzano Godoy</dc:creator>
      <pubDate>Wed, 29 Jan 2020 15:22:12 +0000</pubDate>
      <link>https://dev.to/raquelcampuzano/develop-locally-a-custom-wordpress-using-a-bitnami-docker-image-44ic</link>
      <guid>https://dev.to/raquelcampuzano/develop-locally-a-custom-wordpress-using-a-bitnami-docker-image-44ic</guid>
      <description>&lt;p&gt;&lt;em&gt;Originally published at &lt;a href="https://docs.bitnami.com/tutorials/deploy-locally-custom-wordpress/" rel="noopener noreferrer"&gt;docs.bitnami.com&lt;/a&gt;.&lt;/em&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Why WordPress and Why Containers for Local Development?
&lt;/h1&gt;

&lt;p&gt;When you are searching for an open-source CMS to create your blog or website, chances are that you finally chose &lt;a href="https://wordpress.com/" rel="noopener noreferrer"&gt;WordPress&lt;/a&gt;. &lt;/p&gt;

&lt;p&gt;WordPress is easy to use and includes a lot of plugins and themes enabled by default so you can run your website in a matter of minutes. &lt;/p&gt;

&lt;p&gt;The best way to start developing locally is to use containers. They offer many of the same advantages as developing in VMs, but with lower overhead in terms of developer effort and development machine resources.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://github.com/bitnami/" rel="noopener noreferrer"&gt;Bitnami containers&lt;/a&gt; are a great resource for local development: they allow you to save a lot of time in coding and ensure that you launch always the latest and secure application image. &lt;/p&gt;

&lt;p&gt;As a developer, you may probably want to add some customizations to the default configuration that Bitnami delivers in its containers. This tutorial shows how to add and activate both a custom plugin and a theme for the first run.&lt;/p&gt;

&lt;h1&gt;
  
  
  Set Up Prerequisites
&lt;/h1&gt;

&lt;p&gt;Before starting, make sure that you have already set up the following:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;A Docker environment &lt;a href="https://docs.docker.com/install/" rel="noopener noreferrer"&gt;installed and configured&lt;/a&gt;. &lt;/li&gt;
&lt;li&gt;
&lt;a href="https://dev.toDocker%20Hub%20account"&gt;A Docker Hub account&lt;/a&gt;. &lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Step 1: Create a Script To Add a Plugin and a Theme
&lt;/h1&gt;

&lt;p&gt;To begin the process, you need to obtain the Bitnami Docker image for WordPress.&lt;/p&gt;

&lt;p&gt;1) Clone the &lt;a href="https://github.com/bitnami/bitnami-docker-wordpress" rel="noopener noreferrer"&gt;Bitnami Docker WordPress repository&lt;/a&gt; and change to the directory that contains all files:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

git clone https://github.com/bitnami/bitnami-docker-wordpress.git
&lt;span class="nb"&gt;cd &lt;/span&gt;bitnami-docker-wordpress


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;The next step is to create a script to specify which are the plugins/themes you want to install in your WordPress. This script will contain the instructions to download and uncompress the plugin and the theme files as well as the path where they should be installed &lt;em&gt;(/opt/bitnami/wordpress/wp-content/)&lt;/em&gt;.&lt;/p&gt;

&lt;p&gt;2) In the &lt;em&gt;rootfs/&lt;/em&gt; directory, create a file named &lt;em&gt;download-extra.sh&lt;/em&gt;  with the following content: &lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

&lt;span class="c"&gt;#!/bin/bash&lt;/span&gt;
curl &lt;span class="nt"&gt;-o&lt;/span&gt; /tmp/bbpress2.5.14.zip https://downloads.wordpress.org/plugin/bbpress.2.5.14.zip
curl &lt;span class="nt"&gt;-o&lt;/span&gt; /tmp/gambit.1.5.3.zip https://downloads.wordpress.org/theme/gambit.1.5.3.zip
unzip /tmp/bbpress.2.5.14.zip &lt;span class="nt"&gt;-d&lt;/span&gt; /opt/bitnami/wordpress/wp-content/plugins
unzip /tmp/gambit.1.5.3.zip &lt;span class="nt"&gt;-d&lt;/span&gt; /opt/bitnami/wordpress/wp-content/themes


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h1&gt;
  
  
  Step 2: Edit the Dockerfile To Add the Custom Script
&lt;/h1&gt;

&lt;p&gt;To install the plugins and themes you have selected in the first run, it is necessary to indicate in the Dockerfile where are the instructions to perform that action.&lt;/p&gt;

&lt;p&gt;1) Open the Dockerfile (&lt;em&gt;5/debian-9/Dockerfile&lt;/em&gt;) and add the &lt;em&gt;unzip&lt;/em&gt; packages to the &lt;em&gt;RUN install_packages&lt;/em&gt; command list:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

&lt;span class="c"&gt;# Install required system packages and dependencies&lt;/span&gt;
RUN install_packages unzip libbz2-1.0 libc6 libcomerr2 libcurl3 libexpat1 libffi6 libfreetype6 libgcc1 libgcrypt20 libgmp10 libgnutls30 libgpg-error0 libgssapi-krb5-2 libhogweed4 libicu57 libidn11 libidn2-0 libjpeg62-turbo libk5crypto3 libkeyutils1 libkrb5-3 libkrb5support0 libldap-2.4-2 liblzma5 libmemcached11 libmemcachedutil2 libncurses5 libnettle6 libnghttp2-14 libp11-kit0 libpcre3 libpng16-16 libpq5 libpsl5 libreadline7 librtmp1 libsasl2-2 libsqlite3-0 libssh2-1 libssl1.0.2 libssl1.1 libstdc++6 libsybdb5 libtasn1-6 libtidy5 libtinfo5 libunistring0 libxml2 libxslt1.1 libzip4 zlib1g


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;2) Add the &lt;em&gt;RUN bash download-extra.sh&lt;/em&gt; command under the &lt;em&gt;COPY rootfs/&lt;/em&gt; line:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

COPY rootfs /
RUN bash download-extra.sh


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h1&gt;
  
  
  Step 3: Activate the Plugin and Theme at Initialization Time
&lt;/h1&gt;

&lt;p&gt;To initialize the container with the installed plugin and theme already activated, it is necessary to add this action in the application entrypoint script.&lt;/p&gt;

&lt;p&gt;1) Open the &lt;em&gt;app-entrypoint.sh&lt;/em&gt; (&lt;em&gt;5/debian-9/rootfs/app-entrypoint.sh&lt;/em&gt;) file and add the following:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

nami_initialize apache php mysql-client wordpress
su daemon &lt;span class="nt"&gt;-s&lt;/span&gt; /bin/bash &lt;span class="nt"&gt;-c&lt;/span&gt; &lt;span class="s1"&gt;'/opt/bitnami/wp-cli/bin/wp plugin activate bbpress'&lt;/span&gt;
su daemon &lt;span class="nt"&gt;-s&lt;/span&gt; /bin/bash &lt;span class="nt"&gt;-c&lt;/span&gt; &lt;span class="s1"&gt;'/opt/bitnami/wp-cli/bin/wp theme activate gambit'&lt;/span&gt;
info &lt;span class="s2"&gt;"Starting wordpress... "&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h1&gt;
  
  
  Step 4: Edit the docker-compose.yml File To Point To Your Image
&lt;/h1&gt;

&lt;p&gt;By default, the docker-compose.yml file is pointing to the latest version of the WordPress Docker image packaged by Bitnami. To point to your custom image, it is necessary to change that value in the &lt;em&gt;docker-compose.yml&lt;/em&gt;. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;In the next steps, remember to replace "DOCKER_USERNAME/my-custom-wordpress" with the username of your Docker account and the name of your image, respectively. &lt;/p&gt;
&lt;/blockquote&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight yaml"&gt;&lt;code&gt;

&lt;span class="na"&gt;wordpress&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt;
   &lt;span class="na"&gt;image&lt;/span&gt;&lt;span class="pi"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;'&lt;/span&gt;&lt;span class="s"&gt;DOCKER_USERNAME/my-custom-wordpress:latest'&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h1&gt;
  
  
  Step 5: Build the Docker Image
&lt;/h1&gt;

&lt;p&gt;Let's build the Docker image.&lt;/p&gt;

&lt;p&gt;1) Execute the &lt;em&gt;docker build&lt;/em&gt; command within the directory that contains the Dockerfile (&lt;em&gt;5/debian-9/&lt;/em&gt;):&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

&lt;span class="nb"&gt;cd &lt;/span&gt;5/debian-9/
docker build &lt;span class="nt"&gt;-t&lt;/span&gt; DOCKER_USERNAME/my-custom-wordpress:latest &lt;span class="nb"&gt;.&lt;/span&gt;


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;2) Check that the image has been added to the local repository by executing:&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

docker images | &lt;span class="nb"&gt;grep &lt;/span&gt;my-custom-wordpress


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;
&lt;h1&gt;
  
  
  Step 6: Test the Docker Image and Access Locally To Your Custom Application
&lt;/h1&gt;

&lt;p&gt;To test locally your custom image, it is necessary to run the container.&lt;/p&gt;

&lt;p&gt;1) Execute the &lt;em&gt;docker-compose up&lt;/em&gt; command:&lt;/p&gt;
&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

docker-compose up


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;If everything went well, you should see an output message similar to this:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fktqa45ua133n5kjv69d3.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fktqa45ua133n5kjv69d3.png" alt="Plugin Activated"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;2) Enter &lt;a href="http://localhost" rel="noopener noreferrer"&gt;http://localhost&lt;/a&gt; in your web browser and check that the theme is already activated:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fow5dagi9ada6d75g515g.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2Fow5dagi9ada6d75g515g.png" alt="Theme Activated"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;3) Log in to the WordPress admin panel using the default credentials: username &lt;em&gt;user&lt;/em&gt; and password &lt;em&gt;bitnami&lt;/em&gt;. &lt;/p&gt;

&lt;p&gt;Navigate to the "Plugins" section. You will see the BBplugin already installed and activated:&lt;/p&gt;

&lt;p&gt;&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F7opbmfplqgh73uts3d2u.png" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fi%2F7opbmfplqgh73uts3d2u.png" alt="Plugin Enabled"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Step 7: Publish the Docker Image
&lt;/h1&gt;

&lt;p&gt;Now that your Docker image is built and contains your application code, you can upload it into a public registry. This guide uses &lt;a href="https://hub.docker.com/" rel="noopener noreferrer"&gt;Docker Hub&lt;/a&gt;, but you can select one of your own choice such as:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;a href="https://cloud.google.com/container-registry/" rel="noopener noreferrer"&gt;Google Container Registry&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://aws.amazon.com/ecr/" rel="noopener noreferrer"&gt;Amazon EC2 Container Registry&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://azure.microsoft.com/en-us/services/container-registry/" rel="noopener noreferrer"&gt;Azure container Registry&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://quay.io/" rel="noopener noreferrer"&gt;Quay&lt;/a&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;1) Log in to Docker Hub&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

docker login


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;2) Push the image to your Docker Hub account: &lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight shell"&gt;&lt;code&gt;

docker push DOCKER_USERNAME/my-custom-app:latest


&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;

&lt;p&gt;Congratulations! You have customized a WordPress Docker image, tested and built it, and now it is available in Docker Hub and ready to be deployed in a production scenario! &lt;/p&gt;

&lt;h2&gt;
  
  
  Next Steps
&lt;/h2&gt;

&lt;p&gt;&lt;a href="https://dev.to/raquelcampuzano/deploy-a-custom-wordpress-image-on-a-kubernetes-cluster-using-bitnami-helm-charts-2hmc"&gt;Deploy a Custom WordPress Image on a Kubernetes Cluster Using Bitnami Helm Charts&lt;/a&gt;&lt;/p&gt;

</description>
      <category>docker</category>
      <category>kubernetes</category>
      <category>opensource</category>
      <category>devops</category>
    </item>
  </channel>
</rss>
