/
Dockerfile
47 lines (36 loc) · 1.22 KB
/
Dockerfile
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
45
46
47
# syntax=docker/dockerfile:1
# Get compatible hostname binary for LIMA
FROM opensuse/tumbleweed:latest AS hostname
RUN zypper in -y hostname
# Build wolfi distro for LIMA
FROM cgr.dev/chainguard/wolfi-base:latest
# Install extra packages
COPY wsl-files/extra-packages /
RUN apk update && \
apk upgrade && \
grep -v '^#' /extra-packages | xargs apk add
RUN rm /extra-packages
# Changes root shell to bash
RUN sed -i "/^root/s/ash/bash/" /etc/passwd
# Add systemd symlink to init
RUN ln -s /usr/lib/systemd/systemd /sbin/init
# Add wsl.conf file
COPY wsl-files/wsl.conf /etc/wsl.conf
# Copy hostname binary
COPY --from=hostname /usr/bin/hostname /usr/bin/hostname
# Update the symlink for hostname
RUN rm /bin/hostname && \
ln -s /usr/bin/hostname /bin/hostname
# # Create user
# ARG USERNAME=${username:-lima}
# ARG PASSWORD=${password:-lima}
# ARG USER_ID=1000
# ARG GROUP_ID=1000
# RUN addgroup -g $GROUP_ID $USERNAME && \
# adduser -D -u $USER_ID -G $USERNAME $USERNAME && \
# echo "$USERNAME:$PASSWORD" | chpasswd && \
# echo "$USERNAME ALL=(ALL) NOPASSWD:ALL" >> /etc/sudoers
# # Update wsl.conf file
# RUN sed -i "s/root/$USERNAME/g" /etc/wsl.conf
# # Fix su-exec permissions
# RUN chmod u+s /sbin/su-exec