Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Update Base to Alpine 3.8 #43

Merged
merged 2 commits into from
Oct 23, 2018
Merged

Update Base to Alpine 3.8 #43

merged 2 commits into from
Oct 23, 2018

Conversation

riptidewave93
Copy link
Contributor

This PR should resolve #39, and also updates everything to the latest and greatest tagged versions across the board.

  • Update base image to Alpine 3.8
  • As a part of the base change, the old "DNS" fixes that broke rancher/k8s are gone
  • Install s6 process manager directly
  • Upgraded BATS to 1.1.0
  • Install syslog-ng for postfix logging to stdout

* Update base image to Alpine 3.8
* Install s6 process manager directly
* Upgraded BATS to 1.1.0
* Install syslog-ng for postfix logging to stdout
@riptidewave93
Copy link
Contributor Author

riptidewave93 commented Oct 23, 2018

I have also ran this image in Docker directly, and on kubernetes 1.11.1 as a deployment, and confirmed it works as expected. More testing would be appreciated :)

Copy of my own CI run to show it works:

$ ./script/build.sh latest
./script/build.sh: line 16: drill: command not found
>> Run docker build -t zixia/simple-mail-forwarder:latest .
Sending build context to Docker daemon  282.1kB

Step 1/29 : FROM alpine:3.8
3.8: Pulling from library/alpine
4fe2ade4980c: Pulling fs layer
4fe2ade4980c: Verifying Checksum
4fe2ade4980c: Download complete
4fe2ade4980c: Pull complete
Digest: sha256:621c2f39f8133acb8e64023a94dbdf0d5ca81896102b9e57c0dc184cadaf5528
Status: Downloaded newer image for alpine:3.8
 ---> 196d12cf6ab1
Step 2/29 : LABEL maintainer="Zhuohuan LI <zixia@zixia.net>"
 ---> Running in f3cff2903cfd
Removing intermediate container f3cff2903cfd
 ---> 98c5c09e8bc1
Step 3/29 : ENV BATS_VERSION 1.1.0
 ---> Running in d44486832fb7
Removing intermediate container d44486832fb7
 ---> e251578fc129
Step 4/29 : ENV S6_VERSION 1.21.7.0
 ---> Running in fe77d87c4798
Removing intermediate container fe77d87c4798
 ---> 259701ce4105
Step 5/29 : RUN apk add --update --no-cache         bash         curl         cyrus-sasl         drill         logrotate         openssl         postfix         syslog-ng         && curl -s -o "/tmp/v${BATS_VERSION}.tar.gz" -L         "https://github.com/bats-core/bats-core/archive/v${BATS_VERSION}.tar.gz"     && tar -xzf "/tmp/v${BATS_VERSION}.tar.gz" -C /tmp/     && bash "/tmp/bats-core-${BATS_VERSION}/install.sh" /usr/local         && rm -rf /tmp/*
 ---> Running in e1590be3ebd4
fetch http://dl-cdn.alpinelinux.org/alpine/v3.8/main/x86_64/APKINDEX.tar.gz
fetch http://dl-cdn.alpinelinux.org/alpine/v3.8/community/x86_64/APKINDEX.tar.gz
(1/38) Installing ncurses-terminfo-base (6.1_p20180818-r1)
(2/38) Installing ncurses-terminfo (6.1_p20180818-r1)
(3/38) Installing ncurses-libs (6.1_p20180818-r1)
(4/38) Installing readline (7.0.003-r0)
(5/38) Installing bash (4.4.19-r1)
Executing bash-4.4.19-r1.post-install
(6/38) Installing ca-certificates (20171114-r3)
(7/38) Installing nghttp2-libs (1.32.0-r0)
(8/38) Installing libssh2 (1.8.0-r3)
(9/38) Installing libcurl (7.61.1-r0)
(10/38) Installing curl (7.61.1-r0)
(11/38) Installing db (5.3.28-r0)
(12/38) Installing krb5-conf (1.0-r1)
(13/38) Installing libcom_err (1.44.2-r0)
(14/38) Installing sqlite-libs (3.24.0-r0)
(15/38) Installing heimdal-libs (7.5.0-r1)
(16/38) Installing libsasl (2.1.26-r13)
(17/38) Installing cyrus-sasl (2.1.26-r13)
(18/38) Installing ldns (1.7.0-r0)
(19/38) Installing drill (1.7.0-r0)
(20/38) Installing popt (1.16-r7)
(21/38) Installing logrotate (3.14.0-r0)
(22/38) Installing libcrypto1.0 (1.0.2p-r0)
(23/38) Installing libssl1.0 (1.0.2p-r0)
(24/38) Installing openssl (1.0.2p-r0)
(25/38) Installing postfix (3.3.0-r4)
Executing postfix-3.3.0-r4.pre-install
(26/38) Installing libffi (3.2.1-r4)
(27/38) Installing libintl (0.19.8.1-r2)
(28/38) Installing libuuid (2.32-r0)
(29/38) Installing libblkid (2.32-r0)
(30/38) Installing libmount (2.32-r0)
(31/38) Installing pcre (8.42-r0)
(32/38) Installing glib (2.56.1-r0)
(33/38) Installing hiredis (0.13.3-r1)
(34/38) Installing libbz2 (1.0.6-r6)
(35/38) Installing expat (2.2.5-r0)
(36/38) Installing gdbm (1.13-r1)
(37/38) Installing python2 (2.7.15-r1)
(38/38) Installing syslog-ng (3.13.2-r3)
Executing syslog-ng-3.13.2-r3.post-install
Executing busybox-1.28.4-r1.trigger
Executing ca-certificates-20171114-r3.trigger
Executing glib-2.56.1-r0.trigger
OK: 72 MiB in 51 packages
Installed Bats to /usr/local/bin/bats
Removing intermediate container e1590be3ebd4
 ---> 92d4e57a4c88
Step 6/29 : RUN curl -L -s https://github.com/just-containers/s6-overlay/releases/download/v${S6_VERSION}/s6-overlay-amd64.tar.gz   | tar xzf - -C /
 ---> Running in e77be49ce4fd
Removing intermediate container e77be49ce4fd
 ---> 7f83abba26de
Step 7/29 : COPY install/main.dist.cf /etc/postfix/main.cf
 ---> f784f3aad83b
Step 8/29 : COPY install/master.dist.cf /etc/postfix/master.cf
 ---> fdb49b151208
Step 9/29 : COPY install/syslog-ng.conf /etc/syslog-ng/syslog-ng.conf
 ---> 0665b98ca369
Step 10/29 : RUN cat /dev/null > /etc/postfix/aliases && newaliases     && echo simple-mail-forwarder.com > /etc/hostname         && echo test | saslpasswd2 -p test@test.com     && chown postfix /etc/sasldb2     && saslpasswd2 -d test@test.com
 ---> Running in f94cfc51b9c2
Removing intermediate container f94cfc51b9c2
 ---> 680d6e245b4a
Step 11/29 : WORKDIR /app
 ---> Running in 05332338bc3b
Removing intermediate container 05332338bc3b
 ---> 041224aa4a0e
Step 12/29 : COPY install/init-openssl.sh /app/init-openssl.sh
 ---> 65ea7fe9763c
Step 13/29 : RUN bash -n /app/init-openssl.sh && chmod +x /app/init-openssl.sh
 ---> Running in 343f9ba98bc7
Removing intermediate container 343f9ba98bc7
 ---> 0f336c4a3b38
Step 14/29 : COPY install/postfix.sh /etc/services.d/postfix/run
 ---> 06900c6722c9
Step 15/29 : RUN bash -n /etc/services.d/postfix/run && chmod +x /etc/services.d/postfix/run
 ---> Running in 51b32926a5df
Removing intermediate container 51b32926a5df
 ---> 41e3fff277f3
Step 16/29 : COPY install/syslog-ng.sh /etc/services.d/syslog-ng/run
 ---> 96c8b16dda1a
Step 17/29 : RUN bash -n /etc/services.d/syslog-ng/run && chmod +x /etc/services.d/syslog-ng/run
 ---> Running in c59aa8efff10
Removing intermediate container c59aa8efff10
 ---> d8d244703d28
Step 18/29 : COPY entrypoint.sh /entrypoint.sh
 ---> 3427597adbbb
Step 19/29 : RUN bash -n /entrypoint.sh && chmod a+x /entrypoint.sh
 ---> Running in 0924d818e559
Removing intermediate container 0924d818e559
 ---> 2f52c3b9faf7
Step 20/29 : COPY BANNER /app/
 ---> a74138e8a48b
Step 21/29 : COPY test /app/test
 ---> acfee99258a7
Step 22/29 : COPY .git/logs/HEAD /app/GIT_LOG
 ---> 620f32fb4ba6
Step 23/29 : COPY .git/HEAD /app/GIT_HEAD
 ---> f51ad5a57975
Step 24/29 : COPY install/buildenv.sh /app/
 ---> b21b0a83df48
Step 25/29 : VOLUME ["/var/spool/postfix"]
 ---> Running in f7c439bbbbbb
Removing intermediate container f7c439bbbbbb
 ---> 4cfc11df84e5
Step 26/29 : EXPOSE 25
 ---> Running in a8cfa6ce804a
Removing intermediate container a8cfa6ce804a
 ---> c1a622b7be62
Step 27/29 : ENTRYPOINT ["/entrypoint.sh"]
 ---> Running in 7a6b32f1c7a7
Removing intermediate container 7a6b32f1c7a7
 ---> 11670e650fd4
Step 28/29 : CMD ["start"]
 ---> Running in afbb89775ba7
Removing intermediate container afbb89775ba7
 ---> f5342b44028c
Step 29/29 : RUN bash buildenv.sh
 ---> Running in e506a0be81ec
Error: could not find any address for the name: `wimi.36c33f49.svc.dockerapp.io'
Removing intermediate container e506a0be81ec
 ---> 63f221600df1
Successfully built 63f221600df1
Successfully tagged zixia/simple-mail-forwarder:latest
>> Run docker run --rm --name simple-mail-forwarder zixia/simple-mail-forwarder:latest test
>> Chdir to /app...
 ____  _                 _         __  __       _ _ 
/ ___|(_)_ __ ___  _ __ | | ___   |  \/  | __ _(_) |
\___ \| | '_ ` _ \| '_ \| |/ _ \  | |\/| |/ _` | | |
 ___) | | | | | | | |_) | |  __/  | |  | | (_| | | |
|____/|_|_| |_| |_| .__/|_|\___|  |_|  |_|\__,_|_|_|
                  |_|                               
  _____                                _           
 |  ___|__  _ ____      ____ _ _ __ __| | ___ _ __ 
 | |_ / _ \| '__\ \ /\ / / _` | '__/ _` |/ _ \ '__|
 |  _| (_) | |   \ V  V / (_| | | | (_| |  __/ |   
 |_|  \___/|_|    \_/\_/ \__,_|_|  \__,_|\___|_|   
                                                  

Source#f8e2e2e Tue Oct 23 01:22:02 2018 +0000 * f8e2e2e18b012b7ff0fdf2f68309fcf78990849c
Built on Tue Oct 23 01:22:18 UTC 2018 by e506a0be81ec

>> ENV SMF_DOMAIN not set.
>> END SMF_CONFIG not set.
>> ARGV arguments found. value:[test]
>> Start mail server by test data: SMF_CONFIG=test@test.com:tset@tset.com:test-tset-testo-testi;testo@testo.com:testi@testi.com
Generating a 2048 bit RSA private key
.............................+++++
....+++++
writing new private key to 'smtp.key'
-----
>> SMF_CONFIG found in ENV. use this settings for forward maps.
>> Setting password[test-tset-testo-testi] for user test@test.com ...
>> Setting password[test-tset-testo-testi] for user testo@testo.com ...
Error: could not find any address for the name: `wimi.36c33f49.svc.dockerapp.io'
>> Set hostname to testo.com
>> exec bats test
1..18
ok 1 postfix service installed
ok 2 SMF_CONFIG exist
ok 3 SMF_DOMAIN exist
ok 4 virtual maping source is set
ok 5 virtual maping data is set
ok 6 virtual maping db is set
ok 7 system hostname FQDN resolvable
ok 8 postfix myhostname FQDN & resolvable
ok 9 check other hostname setting
ok 10 confirm postfix is running
ok 11 confirm port 25 is open
ok 12 crond is running # skip skip this for 0.3.0 -> 0.4.0
ok 13 ESMTP STATTLS supported
ok 14 ESMTP AUTH supported
ok 15 ESMTP STARTTLS connect ok
ok 16 create user testi@testo.com by password test
ok 17 ESMTP AUTH by testi@testo.com/test
ok 18 ESMTP TLS AUTH by testi@testo.com/test

@riptidewave93 riptidewave93 mentioned this pull request Oct 23, 2018
These spam the console too much, so disable them.
@huan huan requested a review from dimitrovs October 23, 2018 03:04
@huan
Copy link
Owner

huan commented Oct 23, 2018

Hello @riptidewave93 , I appreciate for your PR which can help us upgrade the alpine to the latest with the fix and other enhancements!

And I have read your changes, it looks good to me.

So before we could double check it before we merge it to the master branch, could you please find at least one reviewer to approve your PR for double checking?

Thank you very much!

Copy link

@danxg87 danxg87 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested and works as expected.
LGTM

@huan huan merged commit dc1b99e into huan:master Oct 23, 2018
@huan
Copy link
Owner

huan commented Oct 23, 2018

Great, let's update the latest docker image and hope it works without any problem.

Please let me know if there are any issues with the latest code, and appreciate your contributions! @danxg87 @riptidewave93

@riptidewave93
Copy link
Contributor Author

Thanks @zixia, if any bugs are reported feel free to tag me in and I will do what I can to sort them out. 👍

@riptidewave93 riptidewave93 deleted the refactor-base branch October 23, 2018 13:22
haratosan pushed a commit to haratosan/docker-simple-mail-forwarder that referenced this pull request Apr 5, 2021
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Waiting for IP address x.x.x.x to be reachable, then fail
3 participants