Sign inSign up

alvin2439/ubuntu-systemd

By alvin2439

•Updated almost 7 years ago

Ubuntu base image with systemd and sshd installed

Image
0

260

alvin2439/ubuntu-systemd repository overview

⁠What is ubuntu-systemd

ubuntu-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⁠

⁠Usage

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

Tag summary

Content type

Image

Digest

Size

80.4 MB

Last updated

almost 7 years ago

docker pull alvin2439/ubuntu-systemd