A "full" ubuntu-server development environment docker image
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
FROM ubuntu:latest | |
LABEL maintainer="SiYu Wu <wu.siyu@hotmail.com>" | |
ENV DEV_USER=user | |
ENV UID=1000 | |
ENV GID=1000 | |
ENV DEF_PASSWD=password | |
ENV TZ=Asia/Shanghai | |
ENV LANG=en_US.UTF-8 | |
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime && echo $TZ > /etc/timezone && \ | |
yes | unminimize && \ | |
apt install -y systemd sudo openssh-server bash-completion zsh git curl vim && \ | |
addgroup --gid $GID $DEV_USER && \ | |
adduser --uid $UID --gid $GID --gecos "" --disabled-password $DEV_USER && \ | |
usermod -aG sudo $DEV_USER && \ | |
echo "$DEV_USER:$DEF_PASSWD" | chpasswd && \ | |
systemctl mask systemd-resolved.service && \ | |
echo "LANG=$LANG" > /etc/default/locale && \ | |
cp /usr/share/doc/util-linux/examples/securetty /etc/securetty | |
CMD ["systemd"] |
Due to the apt cache file is "disabled" in ubuntu's docker image, apt's package name autocompletion will not work.
If you want to make it work, delete the following file in your container:
/etc/apt/apt.conf.d/docker-clean
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Example usage
Build
sudo docker build -t devbox:v0.1 .
Run (w/o privileged)
Run (with privileged)