Sign inSign up

tkwc/mailhog

By tkwc

•Updated over 3 years ago

MailHog image with support for multiple architecture.

Image
0

5.1K

tkwc/mailhog repository overview

⁠Mailhog

Since the official MailHog Docker image don't natively support M1 I needed a custom build for my setup.

Supported architectures: linux/arm64, linux/amd64, linux/amd64/v2, linux/ppc64le & linux/s390x

⁠Github

https://github.com/the-kraken-web-company/mailhog⁠

⁠What it does

Pull golang:1.18-apline⁠ then install MailHog:1.0.1⁠ from source. Finaly it fetch the latest alpine⁠ image and copy compiled MailHog to it to get the lighest image possible. It also fix a bug with boot2docker (github issues #581⁠)

⁠Build, push and usage

⁠Build your own copy

If you want to build your own image and/or version, you can download the original Dockerfile from github and modify it to your needs. You then have to type the following command:

$ docker build -t tkwc/mailhog:<version> -t tkwc/mailhog:latest --platform linux/arm64,linux/amd64,linux/amd64/v2,linux/ppc64le,linux/s390x .

You should replace tkwc with your docker username and mailhog with your image name. You can also change the platform list depending on what's available on your system. To know what's the platform you can build for from your machine type:

$ docker buildx ls
⁠Publish your version

To publish your own version to docker hub, you'll need to type the following commands:

$ docker push tkwc/mailhog:<version>
$ docker push tkwc/mailhog:latest

Where you also changes tkwc with your username and mailhog with your new image name.

⁠Usage in docker compose

To use a custom image in your docker-compose.yml it's like using any other image, all you have to supply is the username and project published to docker hub.

version: "3"
services:
  mailhog:
    image: tkwc/mailhog
    ports:
      - "1025:1025" # smtp server
      - "8025:8025" # web ui
⁠Regular docker usage

Follow the docker run documentation⁠ with the custom image specified:

$ docker run --rm --name my-container-name tkwc/mailhog

Tag summary

Content type

Image

Digest

sha256:45c1bdd08…

Size

11 MB

Last updated

over 3 years ago

docker pull tkwc/mailhog