Docker Image Operations - Create a New Image by Writing Over an Existing Image: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
(Created page with "=Internal= * Image Operations * Dockerfile =Overview= This example demonstrate how to modify an existing Postgresql imag...")
(No difference)

Revision as of 22:29, 15 August 2019

Internal

Overview

This example demonstrate how to modify an existing Postgresql image to add debugging output to the setup logic.

Procedure

Stage New Content

Use the local directory as staging area. Place a new run-postgreql with extra debug output.

Write the Dockerfile

FROM registry.access.redhat.com/rhscl/postgresql-95-rhel7:latest
COPY ./run-postgresql /usr/bin/

Build the Image

docker build -t novaordis/postgresql-debug .

The new image will be placed in the local registry as "novaordis/postgresql-debug:latest".

Run the Image

docker run -e -e POSTGRESQL_USER=... -e POSTGRESQL_PASSWORD=... -e POSTGRESQL_DATABASE=... novaordis/postgresql-debug