Sign inSign up

rusxakep/debian

By rusxakep

•Updated about 5 years ago
Archived

Docker Debian Base Images

Image
0

4.3K

rusxakep/debian repository overview

⁠hub.docker.com/rusxakep/debian

Build Status Docker Pulls Docker Stars Docker Layers

⁠Introduction

Dockerfile to build an debian⁠ container image.

  • Currently tracking Jessie (8), Stretch (9), Buster (10).
  • s6 overlay⁠ enabled for PID 1 init capabilities.
  • zabbix-agent⁠ for individual container monitoring.
  • Cron installed along with other tools (curl, less, logrotate, nano, vim) for easier management.
  • Ability to update User ID and Group ID permissions for development purposes dynamically.

⁠Authors

⁠Table of Contents

⁠Prerequisites

No prerequisites required.

⁠Installation

Automated builds of the image are available on Docker Hub⁠ and is the recommended method of installation.

docker pull rusxakep/debian:(imagetag)

The following image tags are available:

  • latest - Debian Buster - 10
  • buster:latest - Debian Buster - 10
  • stretch:latest - Debian Stretch - 9
  • jessie:latest - Debian Jessie - 8
⁠Quick Start

Utilize this image as a base for further builds. By default, it does not start the S6 Overlay system, but Bash. Please visit the s6 overlay repository⁠ for instructions on how to enable the S6 init system when using this base or look at some of my other images which use this as a base.

⁠Configuration

⁠Data-Volumes

The following directories are used for configure and can be mapped for persistent storage.

DirectoryDescription
/etc/zabbix/zabbix_agentd.conf.d/Zabbix Agent configuration directory
/assets/cron-customDrop custom crontabs here
⁠Environment Variables

Below is the complete list of available options that can be used to customize your installation.

ParameterDescriptionDefault
COLORIZE_OUTPUTEnable/Disable colorized console outputTRUE
CONTAINER_LOG_LEVELControl level of output of container INFO, WARN, NOTICE, DEBUGNOTICE
DEBUG_MODEEnable debug modeFALSE
DEBUG_SMTPSetup mail catch all on port 1025 (SMTP) and 8025 (HTTP)FALSE
ENABLE_CRONEnable CronTRUE
ENABLE_LOGROTATEEnable LogrotateTRUE
ENABLE_SMTPEnable SMTP servicesTRUE
ENABLE_ZABBIXEnable Zabbix AgentTRUE
SKIP_SANITY_CHECKDisable container startup routine checkFALSE
TIMEZONESet TimezoneEtc/GMT

If you wish to have this sends mail, set ENABLE_SMTP=TRUE and configure the following environment variables. See the MSMTP Configuration Options⁠ for further information on options to configure MSMTP.

ParameterDescriptionDefault
ENABLE_SMTP_GMAILAdd setting to support sending through Gmail SMTPFALSE
SMTP_FROMFrom name to send email as[email protected]
SMTP_HOSTHostname of SMTP Serverpostfix-relay
SMTP_PORTPort of SMTP Server25
SMTP_DOMAINHELO domaindocker
SMTP_MAILDOMAINMail domain fromlocal
SMTP_AUTHENTICATIONSMTP Authenticationnone
SMTP_USERSMTP Username (optional)
SMTP_PASSSMTP Password (optional)
SMTP_TLSUse TLSoff
SMTP_STARTTLSStart TLS from within sessionoff
SMTP_TLSCERTCHECKCheck remote certificateoff

See The Official Zabbix Agent Documentation⁠ for information about the following Zabbix values.

ParameterDescriptionDefault
ZABBIX_LOGFILELogfile location/var/log/zabbix/zabbix_agentd.log
ZABBIX_LOGFILESIZELogfile size1
ZABBIX_DEBUGLEVELDebug level1
ZABBIX_REMOTECOMMANDSEnable remote commands (0/1)1
ZABBIX_REMOTECOMMANDS_LOGEnable remote commands Log (0/1)1
ZABBIX_SERVERAllow connections from Zabbix server IP0.0.0.0/0
ZABBIX_LISTEN_PORTZabbix Agent listening port10050
ZABBIX_LISTEN_IPZabbix Agent listening IP0.0.0.0
ZABBIX_START_AGENTSHow many Zabbix Agents to start3
ZABBIX_SERVER_ACTIVEServer for active checkszabbix-proxy
ZABBIX_HOSTNAMEContainer hostname to report to serverdocker
ZABBIX_REFRESH_ACTIVE_CHECKSSeconds to refresh Active Checks120
ZABBIX_BUFFER_SENDBuffer Send5
ZABBIX_BUFFER_SIZEBuffer Size100
ZABBIX_MAXLINES_SECONDMax Lines Per Second20
ZABBIX_ALLOW_ROOTAllow running as root1
ZABBIX_USERZabbix user to start aszabbix

If you enable DEBUG_PERMISSIONS=TRUE all the users and groups have been modified in accordance with environment variables will be displayed in output. e.g. If you add USER_NGINX=1000 it will reset the containers nginx user id from 82 to 1000 - Hint, also change the Group ID to your local development users UID & GID and avoid Docker permission issues when developing.

ParameterDescription
USER_<USERNAME>The user's UID in /etc/passwd will be modified with new UID - Default N/A
GROUP_<GROUPNAME>The group's GID in /etc/group and /etc/passwd will be modified with new GID - Default N/A
GROUP_ADD_<USERNAME>The username will be added in /etc/group after the group name defined - Default N/A
⁠Networking

The following ports are exposed.

PortDescription
1025DEBUG_MODE & DEBUG_SMTP SMTP Catcher
8025DEBUG_MODE & DEBUG_SMTP SMTP HTTP Viewer
10050Zabbix Agent

⁠Debug Mode

When using this as a base image, create statements in your startup scripts to check for existence of DEBUG_MODE=TRUE and set various parameters in your applications to output more detail, enable debugging modes, and so on. In this base image it does the following:

  • Sets zabbix-agent to output logs in verbosity
  • Enables MailHog mailcatcher, which replaces /usr/sbin/sendmail with it's own catchall executable. It also opens port 1025 for SMTP trapping, and you can view the messages it's trapped at port 8025

⁠Maintenance

⁠Shell Access

For debugging and maintenance purposes you may want access the containers shell.

docker exec -it (whatever your container name is e.g. debian) bash

⁠References

Tag summary

Content type

Image

Digest

Size

72.1 MB

Last updated

about 5 years ago

docker pull rusxakep/debian:stretch-latest