How to deploy code-server using docker

How to deploy code-server using docker

Pull the image

# docker pull codercom/code-server
# docker images
REPOSITORY TAG IMAGE ID CREATED SIZE
codercom/code-server latest f3ac734fcec8 12 days ago 802MB

Create a mount directory

# CODE=/home/docker/code
# mkdir $CODE && cd $CODE

Configuration Files

Method 1: Export from the container

Start a container: -u means running as root user

# docker run -d -u root -p 8088:8080 --name code-server -v $CODE:/home/code codercom/code-server
# docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
97707c93cb41 codercom/code-server "/usr/bin/entrypoint…" 3 hours ago Up 3 hours 0.0.0.0: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.yaml
bind-addr: 127.0.0.1:8080
auth: password
password: 59bd4df2841fbc77d67f674f
cert: false

Change password: 123456

Method 2: Create a new configuration file directly

# vim $CODE/config.yaml
bind-addr: 127.0.0.1:8080
auth: password
password: 123456
cert: false

Start the service

# docker stop code-server && docker rm code-server
# docker run -d -u root \
  -p 8088:8080 \
  --name code-server \
  -v $CODE/config.yaml:/root/.config/code-server/config.yaml \
  -v $CODE:/home/code \
  codercom/code-server

For example, visit http://192.168.0.206:8088/

This is the end of this article about docker deployment of code-server. For more relevant docker deployment of code-server content, please search 123WORDPRESS.COM's previous articles or continue to browse the following related articles. I hope everyone will support 123WORDPRESS.COM in the future!

You may also be interested in:
  • Implementation steps for docker deployment of springboot and vue projects
  • How to deploy MongoDB container with Docker
  • Detailed process of installing and deploying onlyoffice in docker
  • Complete steps for deploying confluence with docker

<<:  Solution to data duplication when using limit+order by in MySql paging

>>:  How to use Vue to implement CSS transitions and animations

Recommend

How to use mysqladmin to get the current TPS and QPS of a MySQL instance

mysqladmin is an official mysql client program th...

Causes and solutions for MySQL data loss

Table of contents Preface Problem Description Cau...

Detailed explanation of prototypes and prototype chains in JavaScript

Table of contents Prototype chain diagram Essenti...

uniapp dynamic modification of element node style detailed explanation

Table of contents 1. Modify by binding the style ...

Basic usage of @Font-face and how to make it compatible with all browsers

@Font-face basic introduction: @font-face is a CSS...

jQuery clicks on the love effect

This article shares the specific code of jQuery&#...

Install MySQL5.5 database in CentOS7 environment

Table of contents 1. Check whether MySQL has been...

Vue uses GraphVis to develop an infinitely expanded relationship graph

1. Go to the GraphVis official website to downloa...

Looping methods and various traversal methods in js

Table of contents for loop While Loop do-while lo...

Essential Handbook for Web Design 216 Web Safe Colors

The color presentation on a web page will be affec...

JavaScript to achieve text expansion and collapse effect

The implementation of expanding and collapsing li...

Two ways to open and close the mysql service

Method 1: Use cmd command First, open our DOS win...

Detailed explanation of built-in methods of javascript array

Table of contents 1. Array.at() 2. Array.copyWith...

Tutorial on installing jdk1.8 on ubuntu14.04

1. Download jdk download address我下載的是jdk-8u221-li...