使用DOCKER生成编译环境
编写Dockerfile
FROM ubuntu:16.04 MAINTAINER xx xx RUN apt-get update && apt-get install -y gawk wget git-core diffstat unzip texinfo gcc-multilib build-essential chrpath socat cpio python python3 python3-pip python3-pexpect python3-apt xz-utils debianutils iputils-ping libsdl1.2-dev xterm ncftp imagemagick repo openssh-server vim sudo ninja bc m4 locales flex bison kmod curl gnupg g++-multilib gperf fontconfig zip zlib1g-dev libc6-dev libc6-dev-i386 lib32ncurses5-dev x11proto-core-dev libx11-dev lib32z1-dev libgl1-mesa-dev tofrodos python-markdown python-pip libxml2-utils xsltproc RUN locale-gen en_US.UTF-8 #RUN dpkg-reconfigure locales RUN useradd -m -s /bin/bash funnyman RUN usermod -aG sudo funnyman RUN echo funnyman:rivotek | chpasswd RUN echo root:rivotek | chpasswd RUN echo "if [ -z `ps -e |grep sshd` ] " >> /root/.bashrc RUN echo "then" >> /root/.bashrc RUN echo " service ssh start ">> /root/.bashrc RUN echo "fi" >> /root/.bashrc RUN mkdir /home/funnyman/.ssh/ RUN chown -R funnyman:funnyman /home/funnyman/.ssh/ RUN su - funnyman -c "ssh-keygen -t rsa -P '' -f ~/.ssh/id_rsa" RUN su - funnyman -c "git config --global user.name xx" RUN su - funnyman -c "git config --global user.email xx" RUN echo "ssh-rsa AAAAB3NzaC1yc2EAAAADAQABAAABgQDcin7cpHGkgmEGiGl5ME3VVTmHPDASd2uToZIsG+UA1GI2Twv6XZZnGSQcnY6B9VcDUGhXAAnct8yRmM2C5w/TijDkH+dwNHZc6S0UehvtEWtPBRzCwO7jo5MuSISgxBEdoASH5Bn2rL7pFrdeAUwBmVnqNIpHqQdfhaYEYaC2BqkP+7MJBf+MbrdoR4BZP3eKB+r7gpdlfTJFF9qX9Qya9+iaTgx1BAeSFgY43AAI1bi8uxLMs9Kby5/86UnbCYbHJ2lfM+GU/CF7jyET2Lx9gKEAv4gfA/uO4MMP/UpIGrK4l74XNN8zyNDgAijLjkOLv29DRDdM5pIYEyduEfV8zmtiWMVBmQY7Z0NqO6VQ2LWj7+IV0ra9m7TFLcNSZ/ODDY617JIGiYxJrGbrVviyWMB3oIABwpD5Tj1FBdHCmlLK9H/MKlxLyD/fAUl55VHq5ZyKSo1Hsmyj9lTfiOA6NHsgQZ0/mHn03fd+P2QxRzMNX81mTI1qyb/pV4402x0= funnyman@ThinkCenter" >> /home/funnyman/.ssh/authorized_keys ENV TZ Asia/Shanghai EXPOSE 22
使用docker build生成image
docker build -t rivotek-builder:1604 .
启动 docker
docker run --name rivotek-builder --restart=always --privileged -itd --hostname rivotek-builder -v /home/funnyman/Disk/rivotek-source:/home/funnyman/Disk/rivotek-source -p 6022:22 rivotek-builder:1604 /bin/bash
                    
                
                
            
        
浙公网安备 33010602011771号