zoukankan      html  css  js  c++  java
  • Linux——docker启用配置:dockerfile——ubuntu

    dockerfile

    # base image
    FROM ubuntu:latest
    
    LABEL maintainer="Pan"
    # WORKDIR /app
    
    EXPOSE 3000
    EXPOSE 35729
    
    COPY sources.list /etc/apt
    RUN apt-get update 
    # && apt-get install -y locales 
    # && apt-get install debconf 
    # && echo "Asia/Shanghai" > /etc/timezone 
    # && dpkg-reconfigure -f noninteractive tzdata  
    # && cp /usr/share/zoneinfo/Asia/Shanghai /etc/localtime 
    # && sed -i -e 's/# en_US.UTF-8 UTF-8/en_US.UTF-8 UTF-8/' /etc/locale.gen 
    # && echo 'LANG="en_US.UTF-8"'>/etc/default/locale 
    # && dpkg-reconfigure --frontend=noninteractive locales 
    # && update-locale LANG=en_US.UTF-8 
    && apt-get install -y man 
    && apt-get install manpages 
    && apt-get install manpages-dev 
    && apt-get install manpages-posix 
    && apt-get install manpages-posix-dev
    
    RUN apt-get install -y vim 
    && apt-get install -y procinfo 
    && apt-get install -y searchandrescue 
    && apt-get install -y sysstat 
    && apt-get install net-tools 
    && apt-get install -y iputils-ping
    
    RUN apt-get install -y bind9-utils 
    && apt-get install -y dnsutils 
    && apt-get install -y sysstat
    
    RUN apt-get install -y gcc 
    && apt-get install -y automake  
    && apt-get install -y autoconf  
    && apt-get install -y libtool  
    && apt-get install -y make 
    && apt-get install -y make-doc
    
    RUN  apt-get install -y apt-utils 
    && apt-get install -y pstack 
    && apt-get install -y strace 
    && apt-get update 
    # && apt-get install fuser
    # && apt-get install -y gdb
    
    RUN apt-get install lsof 
    && apt-get install htop 
    && apt-get install -y wget
    
    # CMD ["/bin"]
    # CMD ["/bin", "/run.sh","start"]
    

      

      

    run.sh

    #!/usr/bin/env bash
    set -eo pipefail
    
    pm2 start npm -- start
    if [ -t 0 ]; then
      #tty model
      echo "using TTY model"
    else 
      /usr/bin/tail -f /dev/null
    fi
    

      

    .dockerignore

    #ignore 
    

      

     docker启动命令

    PS D:*****> docker build -t ubuntu_self_practice:v1.1 .
    ……
    Removing intermediate container 872c0672056e
     ---> d9ae6d71651f
    Successfully built d9ae6d71651f
    Successfully tagged ubuntu_self_practice:v1.1
    SECURITY WARNING: You are building a Docker image from Windows against a non-Windows Docker host. All files and directories added to build context will have '-rwxr-xr-x' permissions. It is recommended to double check and reset permissions for sensitive files and directories.
    
    
    PS D:*****> docker run -ti  d9ae6d71651f
    root@e343c6d1b469:/#  
    

     

    参考 

    https://github.com/dockerfile/ubuntu/blob/master/Dockerfile

    https://github.com/dockerfile/ubuntu-desktop

  • 相关阅读:
    Dactor 一个好用的基于协程的全异步框架,适合复杂异步流程
    mysql原表增加字段且设置默认值及修改字段默认值
    js扩展
    mysql建表且设置主键自增
    mysql事务的实现方式——mvvc+锁
    mysql排他锁
    mysql的共享锁
    mysql的体系结构及sql的执行路径
    小程序 使用echarts 数据动态变换
    js 整理 前端知识点 前端面试题 (2020)(vue)
  • 原文地址:https://www.cnblogs.com/panpanwelcome/p/12720303.html
Copyright © 2011-2022 走看看