-
Notifications
You must be signed in to change notification settings - Fork 2
/
Dockerfile.ubuntu
37 lines (31 loc) · 1.39 KB
/
Dockerfile.ubuntu
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
FROM ubuntu:latest
LABEL org.opencontainers.image.authors="Subho Sankar Banerjee <[email protected]>"
LABEL org.opencontainers.image.title="Dotfiles"
LABEL org.opencontainers.image.source="https://github.com/ssbanerje/dotfiles"
ARG user=dotuser
ARG uid=1000
# Setup prereq packages
USER root
ENV DEBIAN_FRONTEND=noninteractive
RUN echo 'APT::Install-Recommends "false";' >> /etc/apt/apt.conf.d/99norecos && \
echo 'APT::AutoRemove::RecommendsImportant "false";' >> /etc/apt/apt.conf.d/99norecos && \
echo 'APT::AutoRemove::SuggestsImportant "false";' >> /etc/apt/apt.conf.d/99norecos && \
apt-get update && \
apt-get install -y sudo python3 python3-pip openssh-client && \
adduser --disabled-password --gecos "" --uid ${uid} ${user} && \
echo "%${user} ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers && \
apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/*
# Setup dotfiles
USER ${user}
ENV DEBIAN_FRONTEND=noninteractive
COPY --chown=${user}:${user} . /home/${user}/.dotfiles
RUN cd /home/${user}/.dotfiles && \
./install_profile -vv -x ubuntu-minimal && \
git remote set-url origin [email protected]:ssbanerje/dotfiles && \
sudo apt-get clean && \
sudo rm -rf /var/lib/apt/lists/* /tmp/* /etc/apt/apt.conf.d/99norecos && \
find /home/${user}/.dotfiles -name "*__pycache__" | xargs rm -rf
# Take command from user
ENTRYPOINT ["/bin/bash", "-l", "-c"]
CMD []
# vi:ft=dockerfile: