Giter Club home page Giter Club logo

dockers's Introduction

主要包含

  • sshd
  • zsh(oh-my-zsh)
  • 自动执行bash

使用说明

ubuntussh 是镜像, ussh 是容器

docker build -t ubuntussh .

-P 开启随机端口, -p 把22绑定到主机的2200端口

docker run -d \
    --name ussh \
    -h ussh \
    -P \
    -p 2200:22 \
    ubuntussh

docker stop ussh; docker rm ussh

查看使用的端口

docker port ussh

停止容器

docker stop ussh

启动容器

docker start ussh

重启容器

docker restart ussh

删除容器

docker rm ussh

删除镜像

docker rmi ubuntussh

ssh连接 ::1 或 localhost

ssh root@::1 -p 2200

docker run -d \
    --name ussh01 \
    -h ussh01 \
    -P \
    -p 2201:22 \
    ubuntussh

docker run -d \
    --name ussh02 \
    -h ussh02 \
    -P \
    -p 2202:22 \
    ubuntussh

docker run -d \
    --name ussh03 \
    -h ussh03 \
    -P \
    -p 2203:22 \
    ubuntussh

docker run -d \
    --name ussh04 \
    -h ussh04 \
    -P \
    -p 2204:22 \
    ubuntussh

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.