Giter VIP home page Giter VIP logo

fedora-init-container's Introduction

Image to run daemons as systemd units

This image serves as a base image. You can easily build on top of it by installing any daemon packaged in Fedora.

WARNING

At the time of writing this document, several bugs prevent running this image conveniently on a Fedora 25 host. The following example describes running this Fedora image on a Centos 7 host. Experience on a Fedora host will be hopefully the same in the future.

Usage

Let us consider httpd as our daemon of choice in this example. In your Dockerfile, do:

FROM fedora-init:25
RUN dnf -y install httpd && dnf clean all && systemctl enable httpd

Build your container:

docker build -t name_of_the_image .

Then run your container:

docker run -d -p 80:80 -v /somedirectory:/var/log/httpd:rw name_of_the_image

Mounting /var/log/httpd is important because by default tmpfs is mounted over /var/log, httpd can not find its subfolder there and fails to start. This is a bug in oci-systemd-hook and will be hopefully solved soon.

To stop the container gracefully, do:

docker stop name_of_the_container

This image has STOPSIGNAL redefined to SIGRTMIN+3, which causes systemd to shutdown cleanly. (The usual STOPSIGNAL SIGTERM stops most of usual processes, but not systemd. Systemd reexecs itself on SIGTERM.) Currently it takes a lot of time to shutdown systemd in a container - longer than the grace period after which it is deemed unresponsive and mercilessly killed by docker.

Procps-ng is installed in this image. You can use it to docker exec somecontainer ps to get info about processes running in a container in a convenient way.

fedora-init-container's People

Stargazers

Christian Glombek avatar

Watchers

James Cloos avatar  avatar Christian Glombek avatar Edward Shen avatar

Forkers

vietchinh

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.