Sign inSign up

liji1991/vscode

By liji1991

Updated almost 5 years ago

Base on ubuntu:latest, only install ssh to connect vscode

Image
0

357

liji1991/vscode repository overview

Dockerfile

FROM ubuntu:latest
RUN sed -i s@/archive.ubuntu.com/@/mirrors.aliyun.com/@g /etc/apt/sources.list
RUN apt-get update && apt-get install -y openssh-client openssh-server
RUN sed -i 's/.*PermitEmptyPasswords no.*/PermitEmptyPasswords yes/g' /etc/ssh/sshd_config 
RUN sed -i 's/.*PermitRootLogin.*/PermitRootLogin yes/g' /etc/ssh/sshd_config 
RUN sed -i 's/.*UsePAM.*/UsePAM no/g' /etc/ssh/sshd_config 
RUN echo "root:123" | chpasswd
#RUN exec bash && source /etc/ssh/sshd_config && service ssh restart
EXPOSE 22

Build

sudo docker build -t "vscode" .

Run

sudo docker run \
    --restart=always \
    --privileged \
    --ulimit core=-1 \
    -idt \
    -p 8000:22 \
    --name=ssh \
    vscode \
    /bin/bash

Exec

sudo docker exec -it ssh /bin/bash

Restart ssh

service ssh restart

Vscode config

    Host ssh
    HostName xxx.xxx.xxx.xxx
    User root
    Port 8000
    IdentityFile "C:\\Users\\xxx\\.ssh\\xxx"

root passwd: 123

Tag summary

Content type

Image

Digest

Size

90.8 MB

Last updated

almost 5 years ago

docker pull liji1991/vscode