aboutsummaryrefslogtreecommitdiffhomepage
path: root/content/2021-12-02-toying-with-virtio/Dockerfile
blob: f892fef5ca0c1b8330d911870e8f44f56ce050c5 (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
FROM ubuntu:20.04
MAINTAINER Johannes Stoelp <johannes.stoelp@gmail.edu>

ARG UID

RUN apt update                     \
 && DEBIAN_FRONTEND=noninteractive \
    apt install                    \
      --yes                        \
      --no-install-recommends      \
      # Download & unpack.
      wget                         \
      ca-certificates              \
      xz-utils                     \
      # Build tools & deps (kernel).
      make                         \
      bc                           \
      gcc g++                      \
      flex bison                   \
      libelf-dev                   \
      libncurses-dev               \
      # Build tools & deps (initrd).
      cpio                         \
      # Run & debug.
      qemu-system-x86              \
      # Convenience.
      sudo                         \
      telnet                       \
      ripgrep                      \
      fd-find                      \
      neovim                       \
 && rm -rf /var/lib/apt/lists/*    \
 && apt-get clean

# Allow 'user' to use sudo without password.
# Convenience in case we want to install some packages in the container later.
RUN echo "user ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers.d/user

# Create user with the UID passed during docker build.
RUN useradd --create-home --home-dir /home/user --uid $UID --shell /bin/bash user
# Start container with user.
USER user
# Change default working dir.
WORKDIR /develop