Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
彭彦祖
code-server
提交
9446cc82
C
code-server
项目概览
彭彦祖
/
code-server
与 Fork 源项目一致
从无法访问的项目Fork
通知
1
Star
1
Fork
0
代码
文件
提交
分支
Tags
贡献者
分支图
Diff
Issue
0
列表
看板
标记
里程碑
合并请求
0
Wiki
0
Wiki
分析
仓库
DevOps
项目成员
Pages
C
code-server
项目概览
项目概览
详情
发布
仓库
仓库
文件
提交
分支
标签
贡献者
分支图
比较
Issue
0
Issue
0
列表
看板
标记
里程碑
合并请求
0
合并请求
0
Pages
分析
分析
仓库分析
DevOps
Wiki
0
Wiki
成员
成员
收起侧边栏
关闭侧边栏
动态
分支图
创建新Issue
提交
Issue看板
体验新版 GitCode,发现更多精彩内容 >>
未验证
提交
9446cc82
编写于
7月 15, 2019
作者:
A
Asher
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Update Dockerfile
上级
68c62087
变更
7
隐藏空白更改
内联
并排
Showing
7 changed file
with
35 addition
and
24 deletion
+35
-24
.dockerignore
.dockerignore
+0
-2
.node-version
.node-version
+1
-1
.travis.yml
.travis.yml
+1
-1
Dockerfile
Dockerfile
+19
-10
README.md
README.md
+4
-4
scripts/ci.bash
scripts/ci.bash
+2
-0
scripts/tasks.bash
scripts/tasks.bash
+8
-6
未找到文件。
.dockerignore
浏览文件 @
9446cc82
Dockerfile
Dockerfile
# Docs
doc/
doc/
# GitHub stuff
.github
.github
.gitignore
.gitignore
.travis.yml
.travis.yml
...
...
.node-version
浏览文件 @
9446cc82
10.1
5.1
10.1
6.0
.travis.yml
浏览文件 @
9446cc82
language
:
node_js
language
:
node_js
node_js
:
node_js
:
-
10.1
5.1
-
10.1
6.0
services
:
services
:
-
docker
-
docker
matrix
:
matrix
:
...
...
Dockerfile
浏览文件 @
9446cc82
FROM
node:10.15.1
FROM
node:10.16.0
ARG
codeServerVersion=docker
ARG
vscodeVersion
# Install VS Code's deps. These are the only two it seems we need.
# Install VS Code's deps. These are the only two it seems we need.
RUN
apt-get update
&&
apt-get
install
-y
\
RUN
apt-get update
&&
apt-get
install
-y
\
...
@@ -11,9 +13,14 @@ RUN npm install -g yarn@1.13
...
@@ -11,9 +13,14 @@ RUN npm install -g yarn@1.13
WORKDIR
/src
WORKDIR
/src
COPY
. .
COPY
. .
# In the future, we can use https://github.com/yarnpkg/rfcs/pull/53 to make yarn use the node_modules
# directly which should be fast as it is slow because it populates its own cache every time.
# In the future, we can use https://github.com/yarnpkg/rfcs/pull/53 to make
RUN
yarn
&&
NODE_ENV
=
production yarn task build:server:binary
# yarn use the node_modules directly which should be fast as it is slow because
# it populates its own cache every time.
RUN
yarn
\
&&
yarn build
"
${
codeServerVersion
}
"
"
${
vscodeVersion
}
"
linux x64
\
&&
yarn binary
"
${
codeServerVersion
}
"
"
${
vscodeVersion
}
"
linux x64
\
&&
mv
"/src/build/code-server
${
codeServerVersion
}
-vsc
${
vscodeVersion
}
-linux-x64"
/src/build/code-server
# We deploy with ubuntu so that devs have a familiar environment.
# We deploy with ubuntu so that devs have a familiar environment.
FROM
ubuntu:18.04
FROM
ubuntu:18.04
...
@@ -30,7 +37,7 @@ RUN apt-get update && apt-get install -y \
...
@@ -30,7 +37,7 @@ RUN apt-get update && apt-get install -y \
wget
wget
RUN
locale-gen en_US.UTF-8
RUN
locale-gen en_US.UTF-8
# We
unfortunately
cannot use update-locale because docker will not use the env variables
# We cannot use update-locale because docker will not use the env variables
# configured in /etc/default/locale so we need to set it manually.
# configured in /etc/default/locale so we need to set it manually.
ENV
LC_ALL=en_US.UTF-8
ENV
LC_ALL=en_US.UTF-8
...
@@ -38,16 +45,18 @@ RUN adduser --gecos '' --disabled-password coder && \
...
@@ -38,16 +45,18 @@ RUN adduser --gecos '' --disabled-password coder && \
echo
"coder ALL=(ALL) NOPASSWD:ALL"
>>
/etc/sudoers.d/nopasswd
echo
"coder ALL=(ALL) NOPASSWD:ALL"
>>
/etc/sudoers.d/nopasswd
USER
coder
USER
coder
# We create first instead of just using WORKDIR as when WORKDIR creates, the user is root.
# We create first instead of just using WORKDIR as when WORKDIR creates, the
# user is root.
RUN
mkdir
-p
/home/coder/project
RUN
mkdir
-p
/home/coder/project
WORKDIR
/home/coder/project
WORKDIR
/home/coder/project
# This
assures we have a volume mounted even if the user forgot to do bind mount.
# This
ensures we have a volume mounted even if the user forgot to do bind
# So that they do not lose their data if they delete the container.
#
mount.
So that they do not lose their data if they delete the container.
VOLUME
[ "/home/coder/project" ]
VOLUME
[ "/home/coder/project" ]
COPY
--from=0 /src/
packages/server/cli-linux-x64
/usr/local/bin/code-server
COPY
--from=0 /src/
build/code-server
/usr/local/bin/code-server
EXPOSE
8443
EXPOSE
8443
EXPOSE
8444
ENTRYPOINT
["dumb-init", "code-server"]
ENTRYPOINT
["dumb-init", "code-server"
, "--host", "0.0.0.0"
]
README.md
浏览文件 @
9446cc82
...
@@ -10,7 +10,7 @@ remote server, accessible through the browser.
...
@@ -10,7 +10,7 @@ remote server, accessible through the browser.
Try it out:
Try it out:
```
bash
```
bash
docker run
-it
-p
127.0.0.1:8443:8443
-
v
"
${
PWD
}
:/home/coder/project"
codercom/code-server
--allow-http
--no-auth
docker run
-it
-p
127.0.0.1:8443:8443
-
p
127.0.0.1:8444:8444
-v
"
$PWD
:/home/coder/project"
codercom/code-server
--allow-http
--no-auth
```
```
-
Code on your Chromebook, tablet, and laptop with a consistent dev environment.
-
Code on your Chromebook, tablet, and laptop with a consistent dev environment.
...
@@ -59,9 +59,9 @@ Quickstart guides for [Google Cloud](doc/admin/install/google_cloud.md),
...
@@ -59,9 +59,9 @@ Quickstart guides for [Google Cloud](doc/admin/install/google_cloud.md),
How to
[
secure your setup
](
/doc/security/ssl.md
)
.
How to
[
secure your setup
](
/doc/security/ssl.md
)
.
### Build
### Build
-
If you also plan on developing, set the
`OUT`
environment variable:
`
-
If you also plan on developing, set the
`OUT`
environment variable:
export OUT=/path/to/some/directory`
. Otherwise it will build in this
`
export OUT=/path/to/some/directory`
. Otherwise it will build in this
directory which will cause issues because
then
`yarn watch`
will try to
directory which will cause issues because
`yarn watch`
will try to
compile the build directory as well.
compile the build directory as well.
-
For now
`@coder/nbin`
is a global dependency.
-
For now
`@coder/nbin`
is a global dependency.
-
Run
`yarn build ${codeServerVersion} ${vscodeVersion} ${target} ${arch}`
in
-
Run
`yarn build ${codeServerVersion} ${vscodeVersion} ${target} ${arch}`
in
...
...
scripts/ci.bash
浏览文件 @
9446cc82
...
@@ -16,6 +16,8 @@ function docker-build() {
...
@@ -16,6 +16,8 @@ function docker-build() {
# TODO: temporary as long as we are rebuilding modules.
# TODO: temporary as long as we are rebuilding modules.
if
[[
"
${
image
}
"
==
"codercom/nbin-alpine"
]]
;
then
if
[[
"
${
image
}
"
==
"codercom/nbin-alpine"
]]
;
then
docker
exec
"
${
containerId
}
"
apk add libxkbfile-dev libsecret-dev
docker
exec
"
${
containerId
}
"
apk add libxkbfile-dev libsecret-dev
else
docker
exec
"
${
containerId
}
"
yum
install
-y
libxkbfile-devel libsecret-devel
fi
fi
function
docker-exec
()
{
function
docker-exec
()
{
...
...
scripts/tasks.bash
浏览文件 @
9446cc82
...
@@ -94,13 +94,13 @@ function build-code-server() {
...
@@ -94,13 +94,13 @@ function build-code-server() {
rm
-rf
"
${
codeServerBuildPath
}
/out/vs/server/typings"
rm
-rf
"
${
codeServerBuildPath
}
/out/vs/server/typings"
# Rebuild to make sure the native modules work since at the moment all the
# Rebuild to make sure the native modules work since at the moment all the
# pre-built packages are from one Linux system
. This means you must build on
# pre-built packages are from one Linux system
which compiles against the
# the target system.
#
latest glibc. This means you must build on
the target system.
log
"Installing remote dependencies"
log
"Installing remote dependencies"
cd
"
${
vscodeSourcePath
}
/remote"
cd
"
${
vscodeSourcePath
}
/remote"
if
[[
"
${
target
}
"
!=
"linux"
]]
;
then
# TODO: vscode-ripgrep errors saying node_modules doesn't exist.
yarn
--production
--force
# TODO: yarn --force should be the same but it doesn't fix it.
fi
npm rebuild
||
true
cp
-r
"
${
vscodeSourcePath
}
/remote/node_modules"
"
${
codeServerBuildPath
}
"
cp
-r
"
${
vscodeSourcePath
}
/remote/node_modules"
"
${
codeServerBuildPath
}
"
# Only keep the production dependencies.
# Only keep the production dependencies.
...
@@ -133,7 +133,9 @@ function build-vscode() {
...
@@ -133,7 +133,9 @@ function build-vscode() {
log
"Installing VS Code dependencies"
log
"Installing VS Code dependencies"
# Not entirely sure why but there seem to be problems with native modules
# Not entirely sure why but there seem to be problems with native modules
# so rebuild them.
# so rebuild them.
yarn
--force
# TODO: vscode-ripgrep errors saying node_modules doesn't exist.
# TODO: yarn --force should be the same but it'.
npm rebuild
||
true
# Keep just what we need to keep the pre-built archive smaller.
# Keep just what we need to keep the pre-built archive smaller.
rm
-rf
"
${
vscodeSourcePath
}
/test"
rm
-rf
"
${
vscodeSourcePath
}
/test"
...
...
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录