Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
code-server
Manage
Activity
Members
Code
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package Registry
Model registry
Operate
Environments
Terraform modules
Analyze
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
coder
code-server
Commits
17267bd8
Commit
17267bd8
authored
5 years ago
by
Anmol Sethi
Committed by
Kyle Carberry
5 years ago
Browse files
Options
Downloads
Patches
Plain Diff
Add Dockerfile and some cleanup (#57)
parent
ac56fcaa
No related branches found
Branches containing commit
Tags
1.31.1-100
Tags containing commit
No related merge requests found
Changes
5
Hide whitespace changes
Inline
Side-by-side
Showing
5 changed files
.dockerignore
+1
-0
1 addition, 0 deletions
.dockerignore
Dockerfile
+26
-0
26 additions, 0 deletions
Dockerfile
README.md
+12
-1
12 additions, 1 deletion
README.md
packages/runner/src/runner.ts
+18
-3
18 additions, 3 deletions
packages/runner/src/runner.ts
scripts/build.sh
+0
-1
0 additions, 1 deletion
scripts/build.sh
with
57 additions
and
5 deletions
.dockerignore
0 → 100644
+
1
−
0
View file @
17267bd8
Dockerfile
This diff is collapsed.
Click to expand it.
Dockerfile
0 → 100644
+
26
−
0
View file @
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
This diff is collapsed.
Click to expand it.
README.md
+
12
−
1
View file @
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
...
...
This diff is collapsed.
Click to expand it.
packages/runner/src/runner.ts
+
18
−
3
View file @
17267bd8
import
*
as
cp
from
"
child_process
"
;
import
{
l
ogger
,
L
ogger
,
field
,
time
}
from
"
@coder/logger
"
;
import
{
field
,
L
ogger
,
l
ogger
,
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
));
...
...
This diff is collapsed.
Click to expand it.
scripts/build.sh
+
0
−
1
View file @
17267bd8
#!/bin/bash
set
-e
npm
install
-g
cross-env
yarn task build:server:binary
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment