Ubuntu base image with systemd and sshd installed
260
ubuntu-systemdubuntu-systemd is an ubuntu image with systemd capability and sshd installed.
This image is build on top of solita/ubuntu-systemd
https://hub.docker.com/r/solita/ubuntu-systemd
As per documentation from solita/ubuntu-systemd, you will first need to prepare the csgroup in your host.
docker run --rm --privileged -v /:/host solita/ubuntu-systemd:18.04 setup
or
docker run --rm --privileged -v /:/host alvin2439/ubuntu-systemd:18.04 setup
Snipplet of docker-compose file
version: '3'
services:
ansible:
image: alvin2439/ubuntu-systemd
cap_add:
- SYS_ADMIN
security_opt:
- seccomp:unconfined
tmpfs:
- /run
- /run/lock
volumes:
- /sys/fs/cgroup:/sys/fs/cgroup:ro
This is a base container with sshd and systemd. For example, to add a user ubuntu, you might need to do as below:
FROM alvin2439/ubuntu-systemd:latest
# Create ubuntu user && add sudo permission
RUN useradd --create-home --shell /bin/bash ubuntu \
&& \
echo 'ubuntu ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers
# Add ssh key
COPY ansible/ssh_keys/default.pub /home/ubuntu/.ssh/authorized_keys
RUN chown -R ubuntu:ubuntu /home/ubuntu/.ssh/ && \
chmod 644 /home/ubuntu/.ssh/authorized_keys && \
chmod 700 /home/ubuntu/.ssh
Content type
Image
Digest
Size
80.4 MB
Last updated
almost 7 years ago
docker pull alvin2439/ubuntu-systemd