Giter Club home page Giter Club logo

docker-arch-systemd's Introduction

Systemd inside ArchLinux

A base Dockerfile with which it is easy to build more specialized systemd-enabled containers.

Prebuild images are available at docker-hub and can be pulled in.

Example

Lets build an image for running a nginx webserver:

Save the following lines in a file called Dockerfile and run docker build -t nginx-test ..

FROM macedigital/docker-arch-systemd
RUN pacman -S nginx --noconfirm; systemctl enable nginx.service
EXPOSE 80
CMD ["/usr/sbin/init"]

After its done, you can run the following command:

docker run --privileged=true -p 127.0.0.1:8888:80 -v /sys/fs/cgroup:/sys/fs/cgroup:ro nginx-test

Voila, go to localhost:8888 on your host machine and rejoice.

Notes

  • Please use a docker version after 1.2.x, which has a fix for moby/moby#2267 (/etc/resolv.conf and /etc/hosts cannot be mounted read-only).

  • You cannot run any such build containers if your host OS does not support systemd (sorry, Ubuntu).

  • At the moment of writing, all containers must be run in privileged mode. Otherwise you will encounter this message Failed to mount tmpfs at /run: Operation not permitted on start.

  • Its necessary to always mount the cgroups filesystem into the container using the -v /sys/fs/cgroup:/sys/fs/cgroup:ro parameter.

Issues

The base Dockerfile should work quite well for any more special purpose build. Nonetheless, feel free to use the issue tracker if you feel something is not right. Also, pull requests are welcomed.

docker-arch-systemd's People

Contributors

macedigital avatar

Watchers

 avatar

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.