GitXplorerGitXplorer
s

docker-f24-systemd

public
0 stars
0 forks
0 issues

Commits

List of commits on branch master.
Unverified
5b434260d81a5b1541951f6e78bd7f08c8623591

Release 1.1.0.

ssathlan committed 8 years ago
Unverified
064bbd463a4d28f19474373559dd23b788741c10

Fixing release task.

ssathlan committed 8 years ago
Unverified
378f20c8acdbc0bf4ee6d2ec17309135a2519448

Adding gitignore file.

ssathlan committed 8 years ago
Unverified
b6325a274ded97330e5818abfc2b8ea128872312

Adding a release task.

ssathlan committed 8 years ago
Unverified
05cfbf80414b60a2aa58c988d54d1c736e272061

Fix/improve text in support files.

ssathlan committed 8 years ago
Unverified
656c685982361be7c615028d7a1fc1e7c28e37cf

Release 1.0.0

ssathlan committed 8 years ago

README

The README file for this repository.

docker-fedora-24-systemd.

Docker Automated buil GitHub release

A fedora 24 docker image that runs with systemd enabled.

The advantages are:

  • no more custom script for running service, just enable them
  • log is handled on the journald host
  • ripping zombie is properly handled
  • signal are properly handled

Install

$ docker run -v /sys/fs/cgroup:/sys/fs/cgroup:ro -t \
    -d --name f24 sathlan/f24-systemd
$ docker exec -ti exec f24 bash

# inside the container
$ dnf install -y nginx
$ systemctl enable nginx
$ systemctl start nginx

Building from Dockerfile

Create a simple dockerfile, where you enable the service and redirect the log.

FROM sathlan/f24-systemd
RUN dnf install -y nginx && dnf clean all
RUN sed -ie 's,.*access_log.*,access_log ^Cslog:server=unix:/dev/log;,' /etc/nginx/nginx.conf
RUN systemctl enable nginx

Build in and run it.

$ docker build -t my/nginx .
$ docker run -p 80:80 -v /sys/fs/cgroup:/sys/fs/cgroup:ro -t \
   -d --name nginx my/nginx

From the host you have the access log in the journal.

$ journalctl -f CONTAINER_NAME=nginx -a &
$ curl -s 127.0.0.1:80 >/dev/null

Test

The host should be CentOS or Fedora. The user running the test should have systemd-journal permission to be able to read the host journal.

$ bundle install
$ bundle exec rake spec:f24-systemd
$ bundle exec rake spec:localhost

The test are dependants. You need to run spec:f24-systemd before running spec:localhost as the former create the service inside the image whose log will be checked in the journal.

Other implementation