Skip to content

Commit

Permalink
Refactor Mailcatcher image
Browse files Browse the repository at this point in the history
  • Loading branch information
atkrad committed May 10, 2019
1 parent f08ae41 commit 7b02e40
Show file tree
Hide file tree
Showing 5 changed files with 58 additions and 16 deletions.
27 changes: 27 additions & 0 deletions .drone.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
kind: pipeline
name: default

steps:
- name: docker
image: plugins/docker
settings:
username:
from_secret: DOCKER_USERNAME
password:
from_secret: DOCKER_PASSWORD
repo: dockage/mailcatcher
auto_tag: true

---
kind: pipeline
name: notify

steps:
- name: microbadger
image: plugins/webhook
settings:
urls:
- https://hooks.microbadger.com/images/dockage/mailcatcher/dmME0uDiXOdm6UrV7n5aXWJBgDM=

depends_on:
- default
26 changes: 16 additions & 10 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,15 +1,21 @@
FROM dockage/alpine:3.5
MAINTAINER Mohammad Abdoli Rad <m.abdolirad@gamil.com>
FROM dockage/alpine:3.9

ENV MAILCATCHER_VERSION=0.6.5
ENV MAILCATCHER_VERSION=0.7.1

RUN apk update \
&& apk --no-cache add g++ make ruby2.2 ruby2.2-dev ruby2.2-json sqlite-dev \
&& gem2.2 install mailcatcher:${MAILCATCHER_VERSION} --no-ri --no-rdoc \
&& apk del g++ make \
&& rm -rf /var/cache/apk/*
LABEL maintainer="m.abdolirad@gmail.com" \
org.label-schema.name="mailcatcher" \
org.label-schema.vendor="Dockage" \
org.label-schema.description="MailCatcher runs a super simple SMTP server which catches any message sent to it to display in a web interface." \
org.label-schema.version="${MAILCATCHER_VERSION}" \
org.label-schema.license="MIT"

RUN apk --no-cache --update add g++ make ruby ruby-dev ruby-json ruby-etc sqlite-dev \
&& gem install mailcatcher:${MAILCATCHER_VERSION} --no-ri --no-rdoc \
&& apk del g++ make

EXPOSE 1025 1080

ENTRYPOINT ["mailcatcher", "-f"]
CMD ["--ip", "0.0.0.0"]
COPY assets/root/ /

ENTRYPOINT ["entrypoint"]
CMD ["mailcatcher", "-f", "--ip", "0.0.0.0"]
6 changes: 3 additions & 3 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
# MailCatcher [![Docker Pulls](https://img.shields.io/docker/pulls/dockage/mailcatcher.svg?style=flat)](https://hub.docker.com/r/dockage/mailcatcher/) [![Docker Stars](https://img.shields.io/docker/stars/dockage/mailcatcher.svg?style=flat)](https://hub.docker.com/r/dockage/mailcatcher/) [![Docker Automated build](https://img.shields.io/docker/automated/dockage/mailcatcher.svg?style=flat)](https://hub.docker.com/r/dockage/mailcatcher/)
# MailCatcher [![Docker Pulls](https://img.shields.io/docker/pulls/dockage/mailcatcher.svg?style=flat)](https://hub.docker.com/r/dockage/mailcatcher/) [![Docker Stars](https://img.shields.io/docker/stars/dockage/mailcatcher.svg?style=flat)](https://hub.docker.com/r/dockage/mailcatcher/) [![MicroBadger Size (latest)](https://img.shields.io/microbadger/image-size/dockage/mailcatcher/latest.svg)](https://microbadger.com/images/dockage/mailcatcher:latest) [![MicroBadger Layers (latest)](https://img.shields.io/microbadger/layers/dockage/mailcatcher/latest.svg)](https://microbadger.com/images/dockage/mailcatcher:latest) [![Build Status](https://cloud.drone.io/api/badges/dockage/mailcatcher/status.svg)](https://cloud.drone.io/dockage/mailcatcher)
[MailCatcher](https://mailcatcher.me) runs a super simple SMTP server which catches any message sent to it to display in a web interface.


Expand All @@ -8,7 +8,7 @@
Pull the image from the docker index. This is the recommended method of installation as it is easier to update image. These builds are performed by the **Docker Trusted Build** service.

```bash
docker pull dockage/mailcatcher:0.6.5
docker pull dockage/mailcatcher:0.7.1
```

Alternately you can build the image locally.
Expand All @@ -35,5 +35,5 @@ Alternately, you can manually launch the `mailcatcher` container.
docker run --name='mailcatcher' -d \
--publish=1080:1080 \
--publish=1025:1025 \
dockage/mailcatcher:0.6.5
dockage/mailcatcher:0.7.1
```
9 changes: 9 additions & 0 deletions assets/root/usr/local/bin/entrypoint
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
#!/bin/sh
set -e

# first arg is `-f` or `--some-option`
if [ "${1#-}" != "$1" ]; then
set -- mailcatcher -f --ip 0.0.0.0 "$@"
fi

exec "$@"
6 changes: 3 additions & 3 deletions docker-compose.yml
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
version: '2'
version: "3"

services:
mailcatcher:
restart: always
image: dockage/mailcatcher:0.6.5
restart: on-failure:10
image: dockage/mailcatcher:0.7.1
ports:
- "1080:1080"
- "1025:1025"

0 comments on commit 7b02e40

Please sign in to comment.