add tasks and correct dockerfile to alpine
All checks were successful
continuous-integration/drone/push Build is passing
All checks were successful
continuous-integration/drone/push Build is passing
This commit is contained in:
parent
85fdb56e87
commit
6efe643f85
@ -5,4 +5,4 @@ name: exec-debian-memiks
|
|||||||
steps:
|
steps:
|
||||||
- name: docker build
|
- name: docker build
|
||||||
commands:
|
commands:
|
||||||
- docker build -t 'opensmtpd-debian' .
|
- docker build -t 'opensmtpd-alpine' .
|
||||||
|
|||||||
36
.vscode/tasks.json
vendored
Normal file
36
.vscode/tasks.json
vendored
Normal file
@ -0,0 +1,36 @@
|
|||||||
|
{
|
||||||
|
// See https://go.microsoft.com/fwlink/?LinkId=733558
|
||||||
|
// for the documentation about the tasks.json format
|
||||||
|
"version": "2.0.0",
|
||||||
|
"tasks": [
|
||||||
|
{
|
||||||
|
"label": "docker build",
|
||||||
|
"type": "shell",
|
||||||
|
"command": "docker build -t ${workspaceFolderBasename} . ",
|
||||||
|
"group": {
|
||||||
|
"kind": "build",
|
||||||
|
"isDefault": true
|
||||||
|
}
|
||||||
|
},
|
||||||
|
{
|
||||||
|
"label": "into docker image",
|
||||||
|
"type": "shell",
|
||||||
|
"windows":{"command": "c:/Program Files/Docker/Docker/Resources/bin/docker"},
|
||||||
|
"args": [
|
||||||
|
"run",
|
||||||
|
"--rm",
|
||||||
|
"-it",
|
||||||
|
"${input:dockerID}",
|
||||||
|
"bash"
|
||||||
|
]
|
||||||
|
}
|
||||||
|
],
|
||||||
|
"inputs": [
|
||||||
|
{
|
||||||
|
"id":"dockerID",
|
||||||
|
"description": "docker id to deep into",
|
||||||
|
"default": "ex: b950ac16e056",
|
||||||
|
"type": "promptString"
|
||||||
|
}
|
||||||
|
]
|
||||||
|
}
|
||||||
78
Dockerfile
78
Dockerfile
@ -1,24 +1,44 @@
|
|||||||
FROM debian
|
FROM alpine
|
||||||
LABEL Maintainer="Memiks <contact@memiks.fr>" \
|
LABEL Maintainer="Memiks <contact@memiks.fr>" \
|
||||||
Description="Lightweight container with OpenSMTPD on Debian Linux."
|
Description="Lightweight container with OpenSMTPD on Alpine Linux."
|
||||||
|
|
||||||
# Install packages
|
# Allow container to expose ports at runtime, if necessary
|
||||||
RUN apt -qy update
|
# https://docs.docker.com/engine/reference/#expose
|
||||||
|
EXPOSE 25
|
||||||
|
EXPOSE 465
|
||||||
|
EXPOSE 587
|
||||||
|
|
||||||
RUN apt-get install -qy \
|
# install necessary packages
|
||||||
build-essential linux-libc-dev \
|
RUN apk add --no-cache \
|
||||||
autoconf automake autoconf bison libevent-dev libasr-dev cmake libtool pkg-config \
|
autoconf \
|
||||||
git curl gawk tar bzip2 ncompress xz-utils tree wget
|
automake \
|
||||||
|
bison \
|
||||||
WORKDIR /tmp
|
ca-certificates \
|
||||||
ENV LIBRESSLVERSION=libressl-3.0.2
|
fts-dev \
|
||||||
RUN wget -O ${LIBRESSLVERSION}.tar.gz https://ftp.openbsd.org/pub/OpenBSD/LibreSSL/${LIBRESSLVERSION}.tar.gz
|
gcc \
|
||||||
RUN tar xf ${LIBRESSLVERSION}.tar.gz
|
fts \
|
||||||
|
libasr-dev \
|
||||||
WORKDIR /tmp/${LIBRESSLVERSION}
|
libevent-dev \
|
||||||
|
libtool \
|
||||||
RUN ./configure --prefix=/usr/local/libressl --with-openssldir=/usr/local/libressl
|
libtool \
|
||||||
RUN make && make install
|
linux-pam-dev \
|
||||||
|
make \
|
||||||
|
musl-dev \
|
||||||
|
openssl \
|
||||||
|
openssl-dev \
|
||||||
|
zlib-dev \
|
||||||
|
git
|
||||||
|
|
||||||
|
# create users and directories
|
||||||
|
# note: alpine uses busybox and useradd is not available there
|
||||||
|
# also long flags are not available too, so sorry for the
|
||||||
|
RUN mkdir -p /var/lib/opensmtpd/empty \
|
||||||
|
&& adduser _smtpd -h /var/lib/opensmtpd/empty/ -D -H -s /bin/false \
|
||||||
|
&& adduser _smtpq -h /var/lib/opensmtpd/empty/ -D -H -s /bin/false \
|
||||||
|
&& mkdir -p /var/spool/smtpd \
|
||||||
|
&& mkdir -p /var/mail \
|
||||||
|
&& mkdir -p /etc/mail \
|
||||||
|
&& chmod 711 /var/spool/smtpd
|
||||||
|
|
||||||
WORKDIR /tmp
|
WORKDIR /tmp
|
||||||
RUN git clone -b portable git://github.com/OpenSMTPD/OpenSMTPD.git opensmtpd
|
RUN git clone -b portable git://github.com/OpenSMTPD/OpenSMTPD.git opensmtpd
|
||||||
@ -26,11 +46,27 @@ RUN git clone -b portable git://github.com/OpenSMTPD/OpenSMTPD.git opensmtpd
|
|||||||
WORKDIR /tmp/opensmtpd
|
WORKDIR /tmp/opensmtpd
|
||||||
RUN ./bootstrap \
|
RUN ./bootstrap \
|
||||||
&& ./configure \
|
&& ./configure \
|
||||||
--with-libssl=/usr/local/libressl
|
--prefix=/usr \
|
||||||
|
--sbindir=/usr/bin \
|
||||||
|
--libexecdir=/usr/lib/smtpd \
|
||||||
|
--sysconfdir=/etc/smtpd \
|
||||||
|
--with-user-smtpd=smtpd \
|
||||||
|
--with-user-queue=smtpq \
|
||||||
|
--with-group-queue=smtpq \
|
||||||
|
--with-gnu-ld \
|
||||||
|
--with-auth-pam
|
||||||
|
|
||||||
RUN make && make install
|
RUN make && make install
|
||||||
|
#RUN etc/aliases /etc/mail/aliases
|
||||||
|
|
||||||
|
RUN addgroup smtpq
|
||||||
|
RUN adduser -D -S -G smtpq smtpq
|
||||||
|
RUN addgroup smtpd
|
||||||
|
RUN adduser -D -S -G smtpd smtpd
|
||||||
|
|
||||||
|
USER smtpd
|
||||||
|
|
||||||
|
WORKDIR /etc/smtpd
|
||||||
|
|
||||||
# Override shell for bash-y debugging goodness
|
# Override shell for bash-y debugging goodness
|
||||||
SHELL ["/bin/bash", "-exc"]
|
SHELL ["/bin/bash", "-exc"]
|
||||||
|
|
||||||
WORKDIR /tmp
|
|
||||||
Loading…
Reference in New Issue
Block a user