{"id":19318346,"url":"https://github.com/nimmis/docker-alpine","last_synced_at":"2025-04-22T17:31:03.417Z","repository":{"id":45564996,"uuid":"51195467","full_name":"nimmis/docker-alpine","owner":"nimmis","description":"Minimal Alpine with working init process","archived":false,"fork":false,"pushed_at":"2021-12-08T10:40:33.000Z","size":36,"stargazers_count":20,"open_issues_count":2,"forks_count":6,"subscribers_count":5,"default_branch":"master","last_synced_at":"2025-04-02T02:05:35.647Z","etag":null,"topics":["alpine","docker","docker-image","supervisor"],"latest_commit_sha":null,"homepage":null,"language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/nimmis.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2016-02-06T08:36:13.000Z","updated_at":"2024-09-27T12:18:01.000Z","dependencies_parsed_at":"2022-07-20T15:49:48.138Z","dependency_job_id":null,"html_url":"https://github.com/nimmis/docker-alpine","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nimmis%2Fdocker-alpine","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nimmis%2Fdocker-alpine/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nimmis%2Fdocker-alpine/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/nimmis%2Fdocker-alpine/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/nimmis","download_url":"https://codeload.github.com/nimmis/docker-alpine/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":250287462,"owners_count":21405617,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["alpine","docker","docker-image","supervisor"],"created_at":"2024-11-10T01:18:18.872Z","updated_at":"2025-04-22T17:31:02.816Z","avatar_url":"https://github.com/nimmis.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"## microcontainer based on Alpine with working init process\n\n[![](https://badge.imagelayers.io/nimmis/alpine:latest.svg)](https://imagelayers.io/?images=nimmis/alpine:latest)\n\nThis is a very small container (51 Mb) but still have a working init process, crond and syslog. This is the base image for all my other microcontainers\n\n### Why use this image\n\nThe unix process ID 1 is the process to receive the SIGTERM signal when you execute a \n\n\tdocker stop \u003ccontainer ID\u003e\n\nif the container has the command `CMD [\"bash\"]` then bash process will get the SIGTERM signal and terminate.\nAll other processes running on the system will just stop without the possibility to shutdown correclty\n\n### my_init init script\n\nIn this container i have a scipt that handles the init process an uses the [supervisor system](http://supervisord.org/index.html) to start\nthe daemons to run and also catch signals (SIGTERM) to shutdown all processes started by supervisord. This is a modified version of\nan init script made by Phusion. I've modified it to use supervisor in stead of runit. There are also two directories to run scripts\nbefore any daemon is started.\n\n#### Run script once /etc/my_runonce\n\nAll executable in this directory is run at start, after completion the script is removed from the directory\n\n#### Run script every start /etc/my_runalways\n\nAll executable in this directory is run at every start of the container, ie, at `docker run` and `docker start`\n\n#### Permanent output to docker log when starting container\n\nEach time the container is started the content of the file /tmp/startup.log is displayed so if your startup scripts generate \nvital information to be shown please add that information to that file. This information can be retrieved anytime by\nexecuting `docker logs \u003ccontainer id\u003e`\n\n### cron daemon\n\nIn many cases there are som need of things happening att given intervalls, default no cron processs is started\nin standard images. In this image cron is running together with logrotate to stop the logdfiles to be\nto big on log running containers.\n\n### rsyslogd\n\nNo all services works without a syslog daemon, if you don't have one running those messages is lost in space,\nall messages sent via the syslog daemon is saved in /var/log/syslog\n\n### Docker fixes \n\nAlso there are fixed (besideds the init process) assosiated with running linux inside a docker container.\n\n### New commands autostarted by supervisord\n\nTo add other processes to run automaticly, add a file ending with .conf  in /etc/supervisor.d/ \nwith a layout like this (/etc/supervisor.d/myprogram.conf) \n\n\t[program:myprogram]\n\tcommand=/usr/bin/myprogram\n\n`myprogram` is the name of this process when working with supervisctl.\n\nOutput logs std and error is found in /var/log/supervisor/ and the files begins with the \u003cdefined name\u003e\u003c-stdout|-stderr\u003esuperervisor*.log\n\nFor more settings please consult the [manual FOR supervisor](http://supervisord.org/configuration.html#program-x-section-settings)\n\n#### starting commands from /etc/init.d/ or commands that detach with my_service\n\nThe supervisor process assumes that a command that ends has stopped so if the command detach it will try to restart it. To work around this\nproblem I have written an extra command to be used for these commands. First you have to make a normal start/stop command and place it in\nthe /etc/init.d that starts the program with\n\n\t/etc/init.d/command start or\n\tservice command start\n\nand stops with\n\n        /etc/init.d/command stop or\n        service command stop\n\nConfigure the configure-file (/etc/supervisor.d/myprogram.conf)\n\n\t[program:myprogram]\n\tcommand=/my_service myprogram\n\nThere is an optional parameter, to run a script after a service has start, e.g to run the script /usr/local/bin/postproc.sh av myprogram is started\n\n        [program:myprogram]\n        command=/my_service myprogram /usr/local/bin/postproc.sh\n\n### Output information to docker logs\n\nThe console output is owned by the my_init process so any output from commands woun't show in the docker log. To send a text from any command, either\nat startup och during run, append the output to the file /var/log/startup.log, e.g sending specific text to log\n\n\techo \"Application is finished\" \u003e\u003e /var/log/startup.log\n\nor output from script\n\n\t/usr/local/bin/myscript \u003e\u003e /var/log/startlog.log\n\n\n\t\u003e docker run -d --name alpine nimmis/alpine\n\t\u003e docker logs microbase\n\t*** open logfile\n\t*** Run files in /etc/my_runonce/\n\t*** Run files in /etc/my_runalways/\n\t*** Booting supervisor daemon...\n\t*** Supervisor started as PID 6\n\t2015-08-04 11:34:06,763 CRIT Set uid to user 0\n\t*** Started processes via Supervisor......\n\tcrond                            RUNNING    pid 9, uptime 0:00:04\n\trsyslogd                         RUNNING    pid 10, uptime 0:00:04\n\n\t\u003e docker exec alpine sh -c 'echo \"Testmessage to log\" \u003e\u003e /var/log/startup.log'\n\t\u003e docker logs alpine\n        *** open logfile\n        *** Run files in /etc/my_runonce/\n        *** Run files in /etc/my_runalways/\n        *** Booting supervisor daemon...\n        *** Supervisor started as PID 6\n        2015-08-04 11:34:06,763 CRIT Set uid to user 0\n        *** Started processes via Supervisor......\n        crond                            RUNNING    pid 9, uptime 0:00:04\n        rsyslogd                         RUNNING    pid 10, uptime 0:00:04\n\n\t*** Log: Testmessage to log\n        \u003e\n\n### Installation\n\nThis continer should normaly run as a daemon i.e with the `-d` flag attached\n\n\tdocker run -d nimmis/alpine\n\nbut if you want to check if all services has been started correctly you can start with the following command\n\n\tdocker run -ti nimmis/alpine\n\nthe output, if working correctly should be\n\n\tdocker run -ti nimmis/alpine\n\t*** open logfile\n\t*** Run files in /etc/my_runonce/\n\t*** Run files in /etc/my_runalways/\n\t*** Booting supervisor daemon...\n\t*** Supervisor started as PID 7\n\t2015-01-02 10:45:43,750 CRIT Set uid to user 0\n\tcrond[10]: crond (busybox 1.24.1) started, log level 8\n\t*** Started processes via Supervisor......\n\tcrond                            RUNNING    pid 10, uptime 0:00:04\n\trsyslogd                         RUNNING    pid 11, uptime 0:00:04\n\npressing a CTRL-C in that window  or running `docker stop \u003ccontainer ID\u003e` will generate the following output\n\n\t*** Shutting down supervisor daemon (PID 7)...\n\t*** Killing all processes...\n\nyou can the restart that container with \n\n\tdocker start \u003ccontainer ID\u003e\n\nAccessing the container with a shell can be done with\n\n\tdocker exec -ti \u003ccontainer ID\u003e /bin/sh\n\n### TAGs\n\nThis image only contains the latest versions of Apline, the versions are\nnimmis/alpine:\u003ctag\u003e where tag is\n\n| Tag    | Alpine version | size |\n| ------ | -------------- | ---- |\n| latest |  latest/3.14    | [![](https://images.microbadger.com/badges/image/nimmis/alpine.svg)](https://microbadger.com/images/nimmis/alpine \"Get your own image badge on microbadger.com\") |\n| test |  latest/edge    | [![](https://images.microbadger.com/badges/image/nimmis/alpine:test.svg)](https://microbadger.com/images/nimmis/alpine:test \"Get your own image badge on microbadger.com\") |\n| 3.14    |  3.14           | [![](https://images.microbadger.com/badges/image/nimmis/alpine:3.14.svg)](https://microbadger.com/images/nimmis/alpine:3.14 \"Get your own image badge on microbadger.com\") |\n| 3.13    |  3.13           | [![](https://images.microbadger.com/badges/image/nimmis/alpine:3.13.svg)](https://microbadger.com/images/nimmis/alpine:3.13 \"Get your own image badge on microbadger.com\") |\n| 3.12    |  3.12           | [![](https://images.microbadger.com/badges/image/nimmis/alpine:3.12.svg)](https://microbadger.com/images/nimmis/alpine:3.12 \"Get your own image badge on microbadger.com\") |\n| 3.11    |  3.11           | [![](https://images.microbadger.com/badges/image/nimmis/alpine:3.11.svg)](https://microbadger.com/images/nimmis/alpine:3.11 \"Get your own image badge on microbadger.com\") |\n| 3.10    |  3.10           | [![](https://images.microbadger.com/badges/image/nimmis/alpine:3.10.svg)](https://microbadger.com/images/nimmis/alpine:3.10 \"Get your own image badge on microbadger.com\") |\n| 3.9    |  3.9           | [![](https://images.microbadger.com/badges/image/nimmis/alpine:3.9.svg)](https://microbadger.com/images/nimmis/alpine:3.9 \"Get your own image badge on microbadger.com\") |\n| 3.8    |  3.8           | [![](https://images.microbadger.com/badges/image/nimmis/alpine:3.8.svg)](https://microbadger.com/images/nimmis/alpine:3.8 \"Get your own image badge on microbadger.com\") |\n| 3.7    |  3.7           | [![](https://images.microbadger.com/badges/image/nimmis/alpine:3.7.svg)](https://microbadger.com/images/nimmis/alpine:3.7 \"Get your own image badge on microbadger.com\") |\n| 3.6    |  3.6           | [![](https://images.microbadger.com/badges/image/nimmis/alpine:3.6.svg)](https://microbadger.com/images/nimmis/alpine:3.6 \"Get your own image badge on microbadger.com\") |\n| 3.5    |  3.5           | [![](https://images.microbadger.com/badges/image/nimmis/alpine:3.5.svg)](https://microbadger.com/images/nimmis/alpine:3.5 \"Get your own image badge on microbadger.com\") |\n| 3.4    |  3.4           | [![](https://images.microbadger.com/badges/image/nimmis/alpine:3.4.svg)](https://microbadger.com/images/nimmis/alpine:3.4 \"Get your own image badge on microbadger.com\") |\n| 3.3    |  3.3           | [![](https://images.microbadger.com/badges/image/nimmis/alpine:3.3.svg)](https://microbadger.com/images/nimmis/alpine:3.3 \"Get your own image badge on microbadger.com\") |\n| 3.2    |  3.2           | [![](https://images.microbadger.com/badges/image/nimmis/alpine:3.2.svg)](https://microbadger.com/images/nimmis/alpine:3.2 \"Get your own image badge on microbadger.com\") |\n| 3.1    |  3.1           | [![](https://images.microbadger.com/badges/image/nimmis/alpine:3.1.svg)](https://microbadger.com/images/nimmis/alpine:3.1 \"Get your own image badge on microbadger.com\") |\n| edge   |  edge          | [![](https://images.microbadger.com/badges/image/nimmis/alpine:edge.svg)](https://microbadger.com/images/nimmis/alpine:edge \"Get your own image badge on microbadger.com\") |\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnimmis%2Fdocker-alpine","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fnimmis%2Fdocker-alpine","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fnimmis%2Fdocker-alpine/lists"}