Skip to content
体验新版
项目
组织
正在加载...
登录
切换导航
打开侧边栏
gzupanda
code-server
提交
17267bd8
C
code-server
项目概览
gzupanda
/
code-server
与 Fork 源项目一致
从无法访问的项目Fork
通知
2
Star
0
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,发现更多精彩内容 >>
提交
17267bd8
编写于
3月 06, 2019
作者:
A
Anmol Sethi
提交者:
Kyle Carberry
3月 06, 2019
浏览文件
操作
浏览文件
下载
电子邮件补丁
差异文件
Add Dockerfile and some cleanup (#57)
上级
ac56fcaa
变更
5
隐藏空白更改
内联
并排
Showing
5 changed file
with
57 addition
and
5 deletion
+57
-5
.dockerignore
.dockerignore
+1
-0
Dockerfile
Dockerfile
+26
-0
README.md
README.md
+12
-1
packages/runner/src/runner.ts
packages/runner/src/runner.ts
+18
-3
scripts/build.sh
scripts/build.sh
+0
-1
未找到文件。
.dockerignore
0 → 100644
浏览文件 @
17267bd8
Dockerfile
Dockerfile
0 → 100644
浏览文件 @
17267bd8
FROM
node:8.15.0
# Install VS Code's deps. These are the only two it seems we need.
RUN
apt-get update
RUN
apt-get
install
-y
libxkbfile-dev libsecret-1-dev
# Ensure latest yarn.
RUN
npm
install
-g
yarn
# In the future, we can use https://github.com/yarnpkg/rfcs/pull/53 to make it use the node_modules
# directly which should be faster.
WORKDIR
/src
COPY
. .
RUN
yarn
RUN
yarn task build:server:binary
# We deploy with ubuntu so that devs have a familiar environemnt.
FROM
ubuntu:18.10
RUN
apt-get update
RUN
apt-get
install
-y
openssl
RUN
apt-get
install
-y
net-tools
WORKDIR
/root/project
COPY
--from=0 /src/packages/server/cli-linux /usr/local/bin/code-server
EXPOSE
8443
# Unfortunately `.` does not work with code-server.
CMD
code-server $PWD
README.md
浏览文件 @
17267bd8
...
...
@@ -7,6 +7,11 @@
`code-server`
is
[
VS Code
](
https://github.com/Microsoft/vscode
)
running on a remote server, accessible through the browser.
Try it out:
```
bash
docker run
-p
localhost:8443:8443
-v
"
${
PWD
}
:/root/project"
codercom/code-server code-server
--allow-http
--no-auth
```
-
Code on your Chromebook, tablet, and laptop with a consistent dev environment.
-
If you have a Windows or Mac workstation, more easily develop for Linux.
-
Take advantage of large cloud servers to speed up tests, compilations, downloads, and more.
...
...
@@ -18,9 +23,15 @@
## Getting Started
### Hosted
[
Try `code-server` now
](
https://coder.com/signup
)
for free at coder.com.
**OR**
### Docker
See docker oneliner mentioned above. Dockerfile is at
[
/Dockerfile
](
/Dockerfile
)
.
### Binaries
1.
[
Download a binary
](
https://github.com/codercom/code-server/releases
)
(
Linux
and OSX supported. Windows coming soon)
2.
Start the binary with the project directory as the first argument
...
...
packages/runner/src/runner.ts
浏览文件 @
17267bd8
import
*
as
cp
from
"
child_process
"
;
import
{
logger
,
Logger
,
field
,
time
}
from
"
@coder/logger
"
;
import
{
field
,
Logger
,
logger
,
time
}
from
"
@coder/logger
"
;
export
interface
CommandResult
{
readonly
exitCode
:
number
;
...
...
@@ -9,7 +9,9 @@ export interface CommandResult {
const
execute
=
(
command
:
string
,
args
:
string
[]
=
[],
options
:
cp
.
SpawnOptions
,
logger
:
Logger
):
Promise
<
CommandResult
>
=>
{
let
resolve
:
(
result
:
CommandResult
)
=>
void
;
const
prom
=
new
Promise
<
CommandResult
>
(
res
=>
resolve
=
res
);
const
prom
=
new
Promise
<
CommandResult
>
((
res
):
void
=>
{
resolve
=
res
;
});
const
stdout
:
string
[]
=
[];
const
stderr
:
string
[]
=
[];
...
...
@@ -45,6 +47,7 @@ export type TaskFunction = (runner: Runner, ...args: any[]) => void | Promise<vo
export
interface
Runner
{
cwd
:
string
;
execute
(
command
:
string
,
args
?:
string
[],
env
?:
object
):
Promise
<
CommandResult
>
;
}
...
...
@@ -91,10 +94,22 @@ export const run = (name: string = process.argv[2]): void | Promise<void> => {
cwd
=
path
;
},
execute
(
command
:
string
,
args
:
string
[]
=
[],
env
?:
object
):
Promise
<
CommandResult
>
{
return
execute
(
command
,
args
,
{
const
prom
=
execute
(
command
,
args
,
{
cwd
,
env
:
env
as
NodeJS
.
ProcessEnv
,
},
log
);
return
prom
.
then
((
result
:
CommandResult
)
=>
{
if
(
result
.
exitCode
!=
0
)
{
log
.
error
(
"
failed
"
,
field
(
"
exitCode
"
,
result
.
exitCode
),
field
(
"
stdout
"
,
result
.
stdout
),
field
(
"
stderr
"
,
result
.
stderr
)
);
}
return
result
;
});
},
},
...
process
.
argv
.
slice
(
3
));
...
...
scripts/build.sh
浏览文件 @
17267bd8
#!/bin/bash
set
-e
npm
install
-g
cross-env
yarn task build:server:binary
编辑
预览
Markdown
is supported
0%
请重试
或
添加新附件
.
添加附件
取消
You are about to add
0
people
to the discussion. Proceed with caution.
先完成此消息的编辑!
取消
想要评论请
注册
或
登录