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

Detailed explanation of this pointing problem in JavaScript

Preface Believe me, as long as you remember the 7...

Installing Windows Server 2008 operating system on a virtual machine

This article introduces the installation of Windo...

Json advantages and disadvantages and usage introduction

Table of contents 1. What is JSON 1.1 Array liter...

JavaScript drag time drag case detailed explanation

Table of contents DragEvent Interface DataTransfe...

Sending emails in html is easy with Mailto

Recently, I added a click-to-send email function t...

MySQL full-text search Chinese solution and example code

MySQL full text search Chinese solution Recently,...

Implementation of React virtual list

Table of contents 1. Background 2. What is a virt...

jQuery implements the drop-down box for selecting the place of residence

The specific code for using jQuery to implement t...

5 Simple XHTML Web Forms for Web Design

Simple XHTML web form in web design 5. Technique ...

Implementation of Vue 3.x project based on Vite2.x

Creating a Vue 3.x Project npm init @vitejs/app m...

Analysis of the use of the MySQL database show processlist command

In actual project development, if we have a lot o...

Several ways to use require/import keywords to import local images in v-for loop

Table of contents Problem Description Method 1 (b...

JavaScript implements div mouse drag effect

This article shares the specific code for JavaScr...