Just 做 IT

求知若饥 虚心若愚 안년하세요 (•‾̑⌣‾̑•)

A Docker File

11 months ago 0


FROM ubuntu:trusty

ENV DEBIAN_FRONTEND noninteractive

ENV MONGO_MAJOR 3.0
ENV MONGO_VERSION 3.0.6

# setting up ssh
RUN mkdir -p /var/run/sshd
RUN useradd solodev -m -p password -s /bin/bash
RUN echo "solodev:password" | chpasswd
RUN echo "solodev ALL=(ALL) NOPASSWD: ALL" >> /etc/sudoers
RUN passwd -e solodev

# chinese language package
RUN locale-gen zh_CN.UTF-8

ADD deltmp.py /usr/bin/deltmp
ADD tmux-dev /usr/bin/tmux-dev
RUN chmod ugo+x /usr/bin/deltmp && chmod ugo+x /usr/bin/tmux-dev

# use 163 sources list
# RUN cp /etc/apt/sources.list /etc/apt/sources.list.orig
# COPY sources.list.trusty /etc/apt/sources.list
RUN echo "deb http://repo.mongodb.org/apt/ubuntu trusty/mongodb-org/3.0 multiverse" > /etc/apt/sources.list.d/mongodb-org.list
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv 7F0CEB10

# update
RUN apt-get update
RUN set -x \
        && apt-get install -y \
        software-properties-common \
        curl
# RUN curl --silent --location https://deb.nodesource.com/setup_4.x | sudo bash -
RUN add-apt-repository ppa:fkrull/deadsnakes -y && apt-get update
RUN apt-get dist-upgrade -y

# install basic software
RUN apt-get install -y \
    cmake \
    git \
    python-dev \
    build-essential \
    vim \
    clang \
    libclang-dev \
    bpython \
    coffeescript \
    dstat \
    git-all \
    htop \
    ipython \
    lsof \
    subversion \
    mercurial \
    mlocate \
    # mongodb-org-mongos=$MONGO_VERSION \
    mongodb-org-shell=$MONGO_VERSION \
    mongodb-org-tools=$MONGO_VERSION \
    # mongodb-org=$MONGO_VERSION \
    openssh-client \
    openssh-server \
    python-pip \
    # python3.5 \
    # python3.5-dev \
    redis-server \
    rpl \
    rubygems-integration \
    silversearcher-ag \
    tmux \
    tree \
    xtail \
    libpcre3-dev \
    libssl-dev \
    libfreetype6-dev \
    libjpeg8-dev

ENV DOWNLOAD /root/download
RUN mkdir $DOWNLOAD
WORKDIR $DOWNLOAD

# install vim-plugin
COPY vimconfig/vimrc /etc/vim/vimrc.local 
RUN git clone https://github.com/gmarik/Vundle.vim.git /usr/share/vim/vimfiles/bundle/Vundle.vim
RUN vim +PluginInstall +qall
ENV YCM_DIR /usr/share/vim/vimfiles/bundle/YouCompleteMe
WORKDIR $YCM_DIR
RUN git submodule update --init --recursive
RUN ./install.py --clang-completer

WORKDIR /root

USER solodev
RUN mkdir /home/solodev/workspace
RUN mkdir /home/solodev/.hgplugin
ADD https://bitbucket.org/GrahamHelliwell/hg-sync/raw/cdb1d3f0ca68766d775746b02b301547ce3af0df/sync.py /home/solodev/.hgplugin/sync.py
ADD https://bitbucket.org/bugheisen/socks_proxy/raw/f93f39eb62038dbe6997bc59a68ab3ea9f4b9306/socks_proxy.py /home/solodev/.hgplugin/
COPY hgrc /home/solodev/.hgrc
COPY hgignore /home/solodev/.hgignore

COPY bashrc /home/solodev/.bashrc
COPY requirement.txt /home/solodev/requirement.txt

USER root
RUN pip install -r /home/solodev/requirement.txt
# solo python libs
RUN virtualenv -p /usr/bin/python2.7 /opt/soloenv
RUN chown -R solodev:solodev /opt/soloenv
RUN chown -R solodev:solodev /home/solodev

ENTRYPOINT ["/usr/sbin/sshd", "-f", "/etc/ssh/sshd_config", "-D"]

Write a Comment