How docker deploys code-server
This article mainly introduces how to deploy code-server in docker, which is very detailed and has certain reference value. Friends who are interested must finish it!
Pull the image # docker pull codercom/code-server# docker imagesREPOSITORY TAG IMAGE ID CREATED SIZEcodercom/code-server latest f3ac734fcec8 12 days ago 802MB to create a mount directory # CODE=/home/docker/code# mkdir $CODE & & cd $CODE configuration file
Method 1: export from the container
Start a container:-u means to run using the root user
# docker run-d-u root-p 8088 CODE:/home/code codercom/code-server# docker psCONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES97707c93cb41 codercom/code-server 8080-- name code-server-v $CODE:/home/code codercom/code-server# docker psCONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES97707c93cb41 codercom/code-server "/ usr/bin/entrypoint …" 3 hours ago Up 3 hours 0.0.0.0 8080/tcp 8088-> 8080/tcp,:: 8088-> 8080/tcp code-server
Pull out the configuration file:
# docker cp code-server:/root/.config/code-server/config.yaml $CODE/# cat $CODE/config.yamlbind-addr: 127.0.0.1:8080auth: passwordpassword: 59bd4df2841fbc77d67f674fcert: false
Change the password: 123456
Method 2: directly create a new configuration file [
# vim $CODE/config.yamlbind-addr: 127.0.0.1:8080auth: passwordpassword: 123456cert: false launch Service # docker stop code-server & & docker rm code-server# docker run-d-u root\-p 8088 CODE:/home/code 8080\-- name code-server\-v $CODE/config.yaml:/root/.config/code-server/config.yaml\-v $CODE:/home/code\ codercom/code-server
Access, for example, http://192.168.0.206:8088/
These are all the contents of the article "how docker deploys code-server". Thank you for reading! Hope to share the content to help you, more related knowledge, welcome to follow the industry information channel!