{"id":18544086,"url":"https://github.com/swagdevops/image-alpine_server","last_synced_at":"2025-05-15T05:31:09.600Z","repository":{"id":54387488,"uuid":"138482125","full_name":"SwagDevOps/image-alpine_server","owner":"SwagDevOps","description":"This image brings a 3 parts init system","archived":false,"fork":false,"pushed_at":"2021-05-21T18:20:45.000Z","size":315,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-02-17T09:15:15.379Z","etag":null,"topics":["alpine","alpine-image","alpine-linux","docker-image","runit"],"latest_commit_sha":null,"homepage":"","language":"Ruby","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/SwagDevOps.png","metadata":{"files":{"readme":"README.md","changelog":"CHANGELOG.md","contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-06-24T13:00:07.000Z","updated_at":"2020-11-24T18:06:22.000Z","dependencies_parsed_at":"2022-08-13T14:10:30.276Z","dependency_job_id":null,"html_url":"https://github.com/SwagDevOps/image-alpine_server","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SwagDevOps%2Fimage-alpine_server","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SwagDevOps%2Fimage-alpine_server/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SwagDevOps%2Fimage-alpine_server/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/SwagDevOps%2Fimage-alpine_server/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/SwagDevOps","download_url":"https://codeload.github.com/SwagDevOps/image-alpine_server/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":254281758,"owners_count":22045015,"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","alpine-image","alpine-linux","docker-image","runit"],"created_at":"2024-11-06T20:15:20.859Z","updated_at":"2025-05-15T05:31:09.581Z","avatar_url":"https://github.com/SwagDevOps.png","language":"Ruby","readme":"# Alpine Server Image\n\nImage based on ``alpine:3.10.3`` ([release notes][release:2019-10-21]).\n\nThis image SHOULD consume less than 6MB RAM on startup (depending on RAM installed).\n\n```sh\nrake restart \u0026\u0026 \\\nsleep 6 \u0026\u0026 \\\ndocker ps | awk '{print $1}' | grep -v CONTAINER | while read line; do docker ps | grep $line | awk '{printf $NF\" \"}' \u0026\u0026 echo \"scale=2; $(cat /sys/fs/cgroup/memory/docker/$line*/memory.usage_in_bytes)/1024/1024\" | bc -l; done | sort | column -t\n```\n\nFor an image size around ``56MB``.\n\n\u003ca name=\"why\"\u003e\u003c/a\u003e\n## Why?\n\n\u003ca name=\"init_process\"\u003e\u003c/a\u003e\n### A complete init process\n\nThis image brings a 3 parts init system, composed of:\n\n1. [``ylem``][ylem] startup scripts execution\n2. [``dumb-init``][dumb-init] minimal init system for Linux containers\n3. [``runit``][runit] services management\n\nIt would solve [the PID 1 problem][blog.phusion.nl:docker-and-the-pid-1-zombie-reaping-problem].\n\n\u003ca name=\"whats_inside\"\u003e\u003c/a\u003e\n## What's inside the image?\n\n| Component        | Comment             |\n| ---------------- | ------------------- |\n| Alpine Linux     | Alpine Linux is a security-oriented, lightweight Linux distribution based on musl libc and busybox. |\n| ``ylem``         | Startup scripts execution. |\n| ``dumb-init``    | A minimal init system for Linux containers. |\n| ``runit``        | Used as a service supervisor. Supports restarting daemons when they crash. See: [``runsvdir``][manpage:runsvdir]. |\n| ``su-exec``      | Execute a program with different privileges. The program will be executed directly and not run as a child, like ``su`` and ``sudo`` does, which avoids TTY and signal issues (see [README][su-exec:README#parentchild-handling]). It is only ``10kb``. |\n| ``sv-utils``     | [``sv-utils``][github.com:SwagDevOps/sv-utils] is an attempt to bring [DRY principle][dry-definition] to runit services creation. |\n| ``syslog``       | Only listens locally. All syslog messages are forwarded to ``docker logs``. |\n| ``dropbear``     | Dropbear is a relatively small SSH server. It has a small memory footprint and is compatible with OpenSSH ``~/.ssh/authorized_keys`` public key authentication. |\n| ``crond``        | Comes with a cron system by default, provided by busybox. |\n\n\u003ca name=\"try\"\u003e\u003c/a\u003e\n## Try\n\n### From sources\n\n```sh\ngit clone git@github.com:SwagDevOps/image-alpine_server.git\ncd image-alpine_server\nbundle install --path vendor/bundle --without development\nbundle exec rake build start exec\n```\n\n### From docker hub\n\n```sh\ndocker run -d --rm --name trying.alpine_server swagdevops/alpine_server:VERSION\n\n```\n\n```sh\ndocker exec -ti trying.alpine_server bash -l\n```\n\n\u003ca name=\"tests\"\u003e\u003c/a\u003e\n## Run tests\n\n```sh\nmkdir -p ssh/authorized_keys\ncp ~/.ssh/id_rsa.pub ssh/authorized_keys/root\nbundle exec rake restart test\n```\n\nTests are executed over ``SSH``, and rely on minimal (host) dependencies.\n\n\u003ca name=\"using\"\u003e\u003c/a\u003e\n## Using as base image\n\n\u003ca name=\"getting_started\"\u003e\u003c/a\u003e\n### Getting started\n\nThe image is called [``swagdevops/alpine_server``][docker_hub.com:swagdevops/alpine_server],\nand is available on the Docker registry.\n\nUse ``swagdevops/alpine_server`` as base image.\n\n```dockerfile\nFROM swagdevops/alpine_server:VERSION\n```\n\nTo make your builds reproducible, you MUST lock down\nto a specific version, DO NOT use [`latest`][vsupalov.com:wrong-with-latest].\nATM, `latest` tag does not exist, as a result: you CAN NOT use it.\n\nSee [releases][github.com:swagdevops/alpine/server/releases]\nfor a list of version numbers.\n\n\u003ca name=\"adding_additional_daemons\"\u003e\u003c/a\u003e\n### Adding additional daemons\n\nA daemon is a program which runs in the background of its system, such\nas a web server.\n\nYou can add additional daemons (for example, your own app) to the image\nby creating runit service directories.\nYou only have to write a small script to start your daemon.\n[``runsv``][manpage:runsv] will execute your script,\nand (by default) restart it upon its exit, after waiting one second.\n\nThe shell script must be called ``run``, executable, and placed in the directory\n``/etc/services/\u003cNAME\u003e``.\nAdditionally, a file ``manifest.yml`` must be present, with the following content:\n\n```yaml\n---\nenabled: true\nauto_start: true\n```\n\n``runsv`` will invoke ``run`` after your container starts.\n\n#### Example for a ``run`` script\n\n```ruby\n#!/usr/bin/env svrun\n# vim: ai ts=2 sts=2 et sw=2 ft=ruby\n\nDir.chdir('/var/www/localhost') do\n  service(['bundle',\n           'exec',\n           'rake',\n           'serve',\n           'serve_port=80',\n           \"serve_storage=/var/serve\"],\n          user: :'www-data',\n          group: 'www-data').call\nend\n```\n\n#### Filesystem hierarchy\n\n```\n/etc/services\n└── httpd\n    ├── manifest.yml\n    └── run\n```\n\nFor more information see: [sv-utils][github.com:swagdevops/sv-utils].\n\n\u003ca name=\"see_also\"\u003e\u003c/a\u003e\n## See also\n\n* [A minimal Ubuntu base image][phusion/baseimage-docker]\n* [Alpine image with environment template and supervisord][qenv/alpine-base]\n* [Petit état de l'art des systèmes d'initialisation][linuxfr:petit-etat-de-l-art]\n\n\u003c!-- hyperlinks references --\u003e\n\n[release:2019-10-21]: https://alpinelinux.org/posts/Alpine-3.10.3-released.html\n[release:2019-08-20]: https://alpinelinux.org/posts/Alpine-3.10.2-released.html\n[release:2019-05-09]: https://alpinelinux.org/posts/Alpine-3.9.4-released.html\n[release:2019-01-29]: https://alpinelinux.org/posts/Alpine-3.9.0-released.html\n[release:2018-06-26]: https://alpinelinux.org/posts/Alpine-3.8.0-released.html\n[dumb-init]: https://github.com/Yelp/dumb-init\n[ylem]: https://github.com/SwagDevOps/ylem\n[runit]: http://smarden.org/runit/\n[su-exec:README#parentchild-handling]: https://github.com/ncopa/su-exec/blob/master/README.md#tty--parentchild-handling\n[blog.phusion.nl:docker-and-the-pid-1-zombie-reaping-problem]: https://blog.phusion.nl/2015/01/20/docker-and-the-pid-1-zombie-reaping-problem/\n[manpage:runsvdir]: http://manpages.ubuntu.com/manpages/bionic/man8/runsvdir.8.html\n[manpage:runsv]: http://smarden.org/runit/runsv.8.html\n[phusion/baseimage-docker]: https://github.com/phusion/baseimage-docker\n[qenv/alpine-base]: https://github.com/qenv/alpine-base\n[linuxfr:petit-etat-de-l-art]: https://linuxfr.org/news/petit-etat-de-l-art-des-systemes-d-initialisation-1\n[github.com:swagdevops/sv-utils]: https://github.com/SwagDevOps/sv-utils\n[docker_hub.com:swagdevops/alpine_server]: https://hub.docker.com/r/swagdevops/alpine_server\n[github.com:swagdevops/alpine/server/releases]: https://github.com/SwagDevOps/image-alpine_server/releases\n[vsupalov.com:wrong-with-latest]: https://vsupalov.com/docker-latest-tag/\n[dry-definition]: https://en.wikipedia.org/wiki/Don%27t_repeat_yourself\n","funding_links":[],"categories":[],"sub_categories":[],"project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fswagdevops%2Fimage-alpine_server","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fswagdevops%2Fimage-alpine_server","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fswagdevops%2Fimage-alpine_server/lists"}