Ghost is a powerful app for new-media creators to publish, share, and grow a business around their content. It comes with modern tools to build a website, publish content, send newsletters & offer paid subscriptions to members.
This Ghost distribution is provided by the upstream Ghost packaging team.
Running Ghost requires a separate database container (MySQL or MariaDB). The following steps show how to run both containers and connect them using a shared Docker network.
This creates a dedicated network that allows the Ghost and database containers to communicate with each other by name.
docker network create ghost-net
Run a MariaDB container on the network. Ghost requires the root user for initial setup, so we provide its password directly.
docker run -d --name ghost-db \
--network ghost-net \
-v db_data:/var/lib/mysql \
-e MARIADB_ROOT_PASSWORD=root \
sourcemation/mariadb
Now, run your Ghost image, connecting it to the same network and pointing it to the database container. You must provide the database credentials and the public URL where your blog will be accessible.
docker run -d --name ghost-app \
--network ghost-net \
-p 8080:2368 \
-v ghost_content:/var/lib/ghost/content \
-e url="http://localhost:8080" \
-e database__client="mysql" \
-e database__connection__host="ghost-db" \
-e database__connection__user="root" \
-e database__connection__password="root" \
-e database__connection__database="ghost" \
sourcemation/ghost
After a minute, your Ghost blog will be available at http://localhost:8080. To access the admin panel and create your administrator account, navigate to http://localhost:8080/ghost.
Ghost is configured using environment variables that follow the ghost config command structure. Use a double underscore (__) to represent nested keys.
| Variable | Description |
|---|---|
url | Required. The full public URL where your blog will be accessible. |
database__client | Required. The type of database client. Note: Use mysql for both MySQL and MariaDB connections. |
database__connection__host | Required. The hostname of the database server (usually the container name). |
database__connection__user | Required. The username for the database. Must be root for initial setup. |
database__connection__password | Required. The password for the database root user. |
database__connection__database | Required. The name of the database Ghost should create and use. |
This image exposes the following ports:
Please note that the ports need to be either manually forwarded with the
-p option or let Docker choose some for you with the -P option.
/var/lib/ghost/content: This directory contains all your site's content, including themes, images, and internal data. Using a volume for this path is essential to make your site persistent.We'd love for you to contribute! You can request new features, report bugs, or submit a pull request with your contribution to this image on the Sourcemation GitHub repository.
Disclaimer: The sourcemation/ghost image is not affiliated with
the Ghost Foundation. The respective companies and
organisations own the trademarks mentioned in the offering. The
sourcemation/ghost image is a separate project and is maintained by
Sourcemation.
A detailed risk analysis report of the image and its components can be found on the Sourcemation platform.
For more information, check out the Ghost website.
The base license for the solution (Ghost) is the MIT License. The licenses for each component shipped as part of this image can be found on the image's appropriate Sourcemation entry.
Content type
Image
Digest
sha256:849208e5f…
Size
510.3 MB
Last updated
3 days ago
docker pull sourcemation/ghost