<p>I am trying to create a pod with both phpmyadmin and adminer in it. I have the Dockerfile created but I am not sure of the entrypoint needed.</p>

<p>Has anyone accomplished this before? I have everything figured out but the entrypoint...</p>

<pre><code>FROM phpmyadmin/phpmyadmin

ENV MYSQL_DATABASE=${MYSQL_DATABASE}
ENV MYSQL_USER=${MYSQL_USERNAME}
ENV MYSQL_ROOT_PASSWORD=${MYSQL_PASSWORD}
ENV MYSQL_PORT=3381
ENV PMA_USER=${MYSQL_USER}
ENV PMA_PORT=3381
ENV PMA_PASSWORD=${MYSQL_PASSWORD}
ENV PMA_HOST=${MYSQL_HOST}

EXPOSE 8081
ENTRYPOINT [ "executable" ]

FROM adminer:4

ENV POSTGRES_DB=${POSTGRES_DATABASE}
ENV POSTGRES_USER=${POSTGRES_USER}
ENV POSTGRES_PASSWORD=${POSTGRES_PASSWORD}

EXPOSE 8082
ENTRYPOINT [ "?" ]
</code></pre>

<p>------UPDATE 1 ----------
after read some comments I spilt my Dockerfiles and will create a yml file for the kube pod</p>

<pre><code>FROM phpmyadmin/phpmyadmin

ENV MYSQL_DATABASE=${MYSQL_DATABASE}
ENV MYSQL_USER=${MYSQL_USERNAME}
ENV MYSQL_ROOT_PASSWORD=${MYSQL_PASSWORD}
ENV MYSQL_PORT=3381
ENV PMA_USER=${MYSQL_USER}
ENV PMA_PORT=3381
ENV PMA_PASSWORD=${MYSQL_PASSWORD}
ENV PMA_HOST=${MYSQL_HOST}

EXPOSE 8081
ENTRYPOINT [ "executable" ]
</code></pre>

<p>container 2</p>

<pre><code>FROM adminer:4

ENV POSTGRES_DB=${POSTGRES_DATABASE}
ENV POSTGRES_USER=${POSTGRES_USER}
ENV POSTGRES_PASSWORD=${POSTGRES_PASSWORD}

EXPOSE 8082
ENTRYPOINT [ "?" ]
</code></pre>

<p>I am still not sure what the entrypoint script should be</p>

Mike3355
<p>Since you are not modifying anything in the image, you don't need to create a custom docker image for this, you could simply run 2 deployments in kubernetes passing the environment variables using a Kubernetes Secret.</p>

<p><strong>See this example of how to deploy both application on Kubernetes:</strong></p>

<ol>
<li><h3>Create a Kubernetes secret with your connection details:</h3></li>
</ol>

<pre class="lang-yaml prettyprint-override"><code>cat &lt;&lt;EOF &gt;./kustomization.yaml
secretGenerator:
- name: database-conn
  literals:
  - MYSQL_DATABASE=${MYSQL_DATABASE}
  - MYSQL_USER=${MYSQL_USER}
  - MYSQL_ROOT_PASSWORD=${MYSQL_ROOT_PASSWORD}
  - MYSQL_PORT=${MYSQL_PORT}
  - POSTGRES_DB=${POSTGRES_DB}
  - POSTGRES_USER=${POSTGRES_USER}
  - POSTGRES_PASSWORD=${POSTGRES_PASSWORD}
EOF
</code></pre>

<p>Apply the generated file:</p>

<pre class="lang-sh prettyprint-override"><code>kubectl apply -k .
secret/database-conn-mm8ck2296m created
</code></pre>

<ol start="2">
<li><h3>Deploy phpMyAdmin and Adminer:</h3></li>
</ol>

<p>You need to create <strong>two</strong> deployment, the first for phpMyAdmin, and other to Adminer, using the secrets created above in the containers, for example:</p>

<p>Create a file called <code>phpmyadmin-deploy.yml</code>:</p>

<blockquote>
  <p>Note: Change the secret name from <code>database-conn-mm8ck2296m</code> to the generated name in the command above.</p>
</blockquote>

<pre class="lang-yaml prettyprint-override"><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: phpmyadmin
spec:
  selector:
    matchLabels:
      app: phpmyadmin
  template:
    metadata:
      labels:
        app: phpmyadmin
    spec:
      containers:
      - name: phpmyadmin
        image: phpmyadmin/phpmyadmin
        env:
        - name: MYSQL_DATABASE
          valueFrom:
            secretKeyRef:
              name: database-conn-mm8ck2296m
              key: MYSQL_DATABASE
        - name: MYSQL_USER
          valueFrom:
            secretKeyRef:
              name: database-conn-mm8ck2296m
              key: MYSQL_USER
        - name: MYSQL_ROOT_PASSWORD
          valueFrom:
            secretKeyRef:
              name: database-conn-mm8ck2296m
              key: MYSQL_ROOT_PASSWORD
        - name: MYSQL_PORT
          valueFrom:
            secretKeyRef:
              name: database-conn-mm8ck2296m
              key: MYSQL_PORT
        - name: PMA_HOST
          value: mysql.host
        - name: PMA_USER
          valueFrom:
            secretKeyRef:
              name: database-conn-mm8ck2296m
              key: MYSQL_USER
        - name: PMA_PASSWORD
          valueFrom:
            secretKeyRef:
              name: database-conn-mm8ck2296m
              key: MYSQL_ROOT_PASSWORD
        - name: PMA_PORT
          valueFrom:
            secretKeyRef:
              name: database-conn-mm8ck2296m
              key: MYSQL_PORT       
        ports:
        - name: http
          containerPort: 80
---
apiVersion: v1
kind: Service
metadata:
  name: phpmyadmin-svc
spec:
  selector:
    app: phpmyadmin
  ports:
    - protocol: TCP
      port: 80
      targetPort: 80
</code></pre>

<p><strong>Adminer:</strong></p>

<p>Create other file named <code>adminer-deploy.yaml</code></p>

<pre class="lang-yaml prettyprint-override"><code>apiVersion: apps/v1
kind: Deployment
metadata:
  name: adminer
spec:
  selector:
    matchLabels:
      app: adminer
  template:
    metadata:
      labels:
        app: adminer
    spec:
      containers:
      - name: adminer
        image: adminer:4
        env:
        - name: POSTGRES_DB
          valueFrom:
            secretKeyRef:
              name: database-conn-mm8ck2296m
              key: POSTGRES_DB
        - name: POSTGRES_USER
          valueFrom:
            secretKeyRef:
              name: database-conn-mm8ck2296m
              key: POSTGRES_USER
        - name: POSTGRES_PASSWORD
          valueFrom:
            secretKeyRef:
              name: database-conn-mm8ck2296m
              key: POSTGRES_PASSWORD  
        ports:
        - name: http
          containerPort: 8080
---
apiVersion: v1
kind: Service
metadata:
  name: adminer-svc
spec:
  selector:
    app: adminer
  ports:
    - protocol: TCP
      port: 8080
      targetPort: 8080
</code></pre>

<p>Deploy the yaml files with <code>kubectl apply -f *-deploy.yaml</code>, after some seconds type <code>kubectl get pods &amp;&amp; kubectl get svc</code> to verify if everything is ok.</p>

<blockquote>
  <p><strong>Note:</strong> Both services will be created as <code>ClusterIP</code>, it means that it will be only accessible internally. If you are using a cloud provider, you can use <a href="https://kubernetes.io/docs/concepts/services-networking/service/#publishing-services-service-types" rel="nofollow noreferrer">service type</a> <code>LoadBalancer</code> to get an external ip. Or you can use <code>kubectl port-forward</code> (<a href="https://kubernetes.io/docs/tasks/access-application-cluster/port-forward-access-application-cluster/#forward-a-local-port-to-a-port-on-the-pod" rel="nofollow noreferrer">see here</a>) command to access your service from your computer. </p>
</blockquote>

<p>Access application using port-forward:</p>

<p><strong>phpMyadmin:</strong></p>

<pre><code># This command will map the port 8080 from your localhost to phpMyadmin application:
kubectl port-forward svc/phpmyadmin-svc 8080:80
</code></pre>

<p><strong>Adminer</strong></p>

<pre><code># This command will map the port 8181 from your localhost to Adminer application:
kubectl port-forward svc/adminer-svc 8181:8080
</code></pre>

<p>And try to access: </p>

<p><a href="http://localhost:8080" rel="nofollow noreferrer">http://localhost:8080</a> &lt;= phpMyAdmin
<a href="http://localhost:8181" rel="nofollow noreferrer">http://localhost:8181</a> &lt;= Adminer</p>

<p><strong>References:</strong></p>

<p><a href="https://kubernetes.io/docs/concepts/configuration/secret/" rel="nofollow noreferrer">Kubernetes Secrets</a></p>

<p><a href="https://kubernetes.io/docs/tasks/inject-data-application/define-environment-variable-container/" rel="nofollow noreferrer">Kubernetes Environment variables</a></p>

<p><a href="https://kubernetes.io/docs/tasks/access-application-cluster/port-forward-access-application-cluster/" rel="nofollow noreferrer">Kubernetes port forward</a></p>
