Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add instructions on how to get systemd based services running #13

Open
wants to merge 1 commit into
base: master
Choose a base branch
from
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
16 changes: 16 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -96,6 +96,22 @@ Vagrant.configure(2) do |config|
end
```

### How to run systemd services in the Docker Base Image?

You probably noticed that running systemd services usually does not work in docker containers. Still, sometimes it would be useful to have that work (e.g. when testing systemd based services in a docker baseimage). A simple way to do that is to use the `systemctl` binary with gdraheim/docker-systemctl-replacement:

```ruby
Vagrant.configure(2) do |config|
config.vm.provider "docker" do |docker, override|
docker.image = "tknerr/baseimage-ubuntu:18.04"
# inject docker systemctl replacement so we can use systemd in the docker container
override.vm.provision "shell", privileged: true, inline: <<-EOF
sudo wget -O /bin/systemctl https://raw.githubusercontent.com/gdraheim/docker-systemctl-replacement/master/files/docker/systemctl.py
EOF
end
end
```


## Contribute

Expand Down