work/Dockerfile

208 lines
4.1 KiB
Docker
Raw Normal View History

2020-05-26 07:07:46 +00:00
# focal as of 2020-04-23
FROM ubuntu@sha256:5747316366b8cc9e3021cd7286f42b2d6d81e3d743e2ab571f55bcd5df788cc8
2020-04-11 16:55:32 +00:00
2020-04-11 17:53:41 +00:00
ENV DEBIAN_FRONTEND noninteractive
2020-05-16 11:28:48 +00:00
ARG UBUNTU_MIRROR=http://archive.ubuntu.com/ubuntu
2020-04-11 17:53:41 +00:00
ARG UID_TO_ADD=1000
ARG GID_TO_ADD=1000
2020-05-26 07:07:46 +00:00
ARG USERNAME_TO_ADD=user
2020-04-11 17:53:41 +00:00
RUN \
echo "deb $UBUNTU_MIRROR focal main universe restricted multiverse" > /etc/apt/sources.list.new && \
echo "deb $UBUNTU_MIRROR focal-updates main universe restricted multiverse" >> /etc/apt/sources.list.new && \
echo "deb $UBUNTU_MIRROR focal-security main universe restricted multiverse" >> /etc/apt/sources.list.new && \
echo "deb $UBUNTU_MIRROR focal-backports main universe restricted multiverse" >> /etc/apt/sources.list.new && \
mv /etc/apt/sources.list.new /etc/apt/sources.list
2020-05-26 07:07:46 +00:00
RUN \
groupadd -g $GID_TO_ADD $USERNAME_TO_ADD && \
groupadd nixbld && \
useradd -u $UID_TO_ADD -g $GID_TO_ADD --home-dir /home/user -m -s /bin/bash $USERNAME_TO_ADD && \
usermod -p '*' $USERNAME_TO_ADD
2020-04-11 17:53:41 +00:00
ADD https://sneak.cloud/authorized_keys /root/.ssh/authorized_keys
2020-05-26 07:07:46 +00:00
ADD https://sneak.cloud/authorized_keys /home/user/.ssh/authorized_keys
2020-04-11 17:53:41 +00:00
# we only install essential system packages here
2020-05-26 07:07:46 +00:00
ARG SYSTEM_PACKAGES="\
anacron \
apt-transport-https \
build-essential \
byobu \
ca-certificates \
cron \
cronic \
curl \
git \
golang \
locales \
openssh-server \
rsync \
runit \
sudo \
tmux \
"
2020-04-11 17:53:41 +00:00
2020-07-08 07:26:10 +00:00
RUN /bin/bash -c "echo -e 'Y\n\n' | /usr/local/sbin/unminimize"
2020-04-11 17:53:41 +00:00
RUN \
apt update && \
apt -y upgrade && \
apt -y install $SYSTEM_PACKAGES && \
go get -v -u github.com/peterbourgon/runsvinit && \
cp /root/go/bin/runsvinit /usr/local/sbin/runsvinit && \
rm -rf /root/go && \
2020-05-26 07:07:46 +00:00
rm /etc/ssh/*host*key* && \
apt -y purge golang && \
apt -y autoremove
2020-04-11 17:53:41 +00:00
2020-05-26 07:07:46 +00:00
# nix for pkgs pls
RUN mkdir /nix && chown user:user /nix
ARG OTHER_PACKAGES=" \
apt-utils \
aspell \
aspell-en \
automake \
avahi-daemon \
avahi-utils \
bash-completion \
bc \
bind9-host \
bonnie++ \
build-essential \
byobu \
ca-certificates \
cmake \
curl \
daemontools \
debmirror \
default-jdk \
default-jre \
diffstat \
dnsutils \
docker.io \
dos2unix \
editorconfig \
ffmpeg \
fonts-indic \
fonts-ipafont-gothic \
fonts-ipafont-mincho \
fortune \
git \
gnupg2 \
gnupg-agent \
golang-go \
host \
imagemagick \
iputils-ping \
irssi \
jq \
lcov \
ldap-auth-client \
ldap-utils \
libasound2 \
libatk1.0-0 \
libboost-all-dev \
libbz2-dev \
libdb++-dev \
libffi-dev \
libgconf-2-4 \
libgtk-3-0 \
libjpeg-dev \
liblzma-dev \
libncurses5-dev \
libnss3 \
libnss-mdns \
libpng-dev \
libreadline-dev \
libsqlite3-dev \
libssl-dev \
libtool \
libxcursor1 \
libxml2 \
libxml2-dev \
libxmlsec1-dev \
libxslt1-dev \
llvm \
locales \
lsof \
mailutils \
make \
man \
man-db \
mercurial \
mosh \
mutt \
netcat-openbsd \
nmap \
nscd \
openssh-server \
pandoc \
pass \
pbzip2 \
pinentry-curses \
pkg-config \
psmisc \
pv \
pwgen \
python3 \
python3-dev \
python3-pip \
rbenv \
rsync \
rsyslog \
rsyslog-gnutls \
rsyslog-relp \
screen \
snmp \
snmpd \
socat \
software-properties-common \
strace \
sudo \
tcpdump \
telnet \
texlive-latex-base \
tk-dev \
tmux \
tree \
ttf-wqy-microhei \
ttf-wqy-zenhei \
vagrant \
vim \
vim-gtk \
wamerican-insane \
wget \
xterm \
xz-utils \
zfsutils-linux \
zip \
zlib1g-dev \
"
#RUN apt -y install $OTHER_PACKAGES
2020-05-26 07:07:46 +00:00
USER root
ENV HOME /root
COPY ./root /
2020-04-11 19:09:15 +00:00
COPY ./build /tmp/build
2020-04-11 17:53:41 +00:00
2020-05-26 07:07:46 +00:00
RUN bash /tmp/build/root.sh
USER user
ENV HOME /home/user
RUN bash /tmp/build/user.sh
2020-04-11 17:53:41 +00:00
2020-05-26 07:07:46 +00:00
USER root
ENV HOME /root
RUN rm -rf /tmp/build
RUN chsh --shell /home/user/.nix-profile/bin/zsh user
RUN chmod +rx /etc/service/*/run
2020-04-11 17:53:41 +00:00
CMD ["/usr/local/sbin/runsvinit"]