Public Repository

Last pushed: 6 months ago
Short Description
ubuntu based develop environment 基于ubuntu的开发环境镜像
Full Description

tag说明

  • sandy1890/ubuntu:base

    基础的ubuntu环境,root密码:123

  • sandy1890/ubuntu:web

    tenginx + php7.4.1 + php5.6.30

Dockerfile


FROM ubuntu:16.04
MAINTAINER sandy

ADD sources.list /etc/apt/sources.list


# 更新源
RUN apt-get update

# 安装常用软件
RUN apt-get install -y ntpdate iputils-ping libreadline6 \
    net-tools libreadline6-dev liblocal-lib-perl openssh-server sudo vim

# 安装中文语言支持
RUN apt-get install -y locales
RUN locale-gen zh_CN.UTF-8
RUN DEBIAN_FRONTEND=noninteractive dpkg-reconfigure locales
ENV LANG zh_CN.utf8  
ENV LANGUAGE zh_CN:zh  
ENV LC_ALL zh_CN.utf8

# 时区设置
RUN apt-get install -y tzdata
ENV TZ "Asia/Shanghai"
RUN echo $TZ > /etc/timezone
RUN rm /etc/localtime
RUN ln -snf /usr/share/zoneinfo/$TZ /etc/localtime
RUN dpkg-reconfigure -f noninteractive tzdata

#设置root密码以及允许sshd通过密码登录
RUN mkdir /var/run/sshd
RUN echo 'root:123' | chpasswd
RUN sed -i 's/PermitRootLogin prohibit-password/PermitRootLogin yes/' /etc/ssh/sshd_config
# ssh登录设置,若不做调整,登录容器后会被强制退出,无法正常登录
RUN sed 's@session\s*required\s*pam_loginuid.so@session optional pam_loginuid.so@g' -i /etc/pam.d/sshd

RUN echo "export VISIBLE=now" >> /etc/profile
RUN apt-get clean

EXPOSE 22
EXPOSE 80
EXPOSE 8080
EXPOSE 9000
EXPOSE 3306

CMD ["/usr/sbin/sshd", "-D"]

sources.list 文件


deb http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse
deb http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-security main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-updates main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-proposed main restricted universe multiverse
deb-src http://mirrors.aliyun.com/ubuntu/ xenial-backports main restricted universe multiverse

Docker Pull Command
Owner
sandy1890