Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

make docker build working with after a fresh checkout #72

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
11 changes: 11 additions & 0 deletions .dockerignore
@@ -1 +1,12 @@
.git
.gitignore
Dockerfile
lib
node_modules
**/dist
**/out
.DS_Store
*.DS_Store
release
**/yarn-error.log
**/node_modules
1 change: 1 addition & 0 deletions .gitignore
Expand Up @@ -4,3 +4,4 @@ dist
out
.DS_Store
release
yarn-error.log
6 changes: 3 additions & 3 deletions Dockerfile
@@ -1,4 +1,4 @@
FROM node:8.15.0
FROM node:8.9.3
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Why the change?


# Install VS Code's deps. These are the only two it seems we need.
RUN apt-get update && apt-get install -y \
Expand All @@ -18,7 +18,7 @@ RUN yarn && yarn task build:server:binary
# We deploy with ubuntu so that devs have a familiar environemnt.
FROM ubuntu:18.10
WORKDIR /root/project
COPY --from=0 /src/packages/server/cli-linux /usr/local/bin/code-server
COPY --from=0 /src/packages/server/cli-linux-x64 /usr/local/bin/code-server
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

afaik, there shouldn't be a -x64 suffix?

@kylecarbs

Copy link
Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

There should be - that is actually the only output

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Yup. This was recently changed without me knowing. It's fixed in #109.

EXPOSE 8443
RUN apt-get update && apt-get install -y \
openssl \
Expand All @@ -29,4 +29,4 @@ RUN apt-get install -y locales && \
# configured in /etc/default/locale so we need to set it manually.
ENV LANG=en_US.UTF-8
# Unfortunately `.` does not work with code-server.
CMD code-server $PWD
CMD code-server $PWD
6 changes: 5 additions & 1 deletion build/tasks.ts
Expand Up @@ -224,7 +224,7 @@ const ensureCloned = register("vscode:clone", async (runner) => {
}

runner.cwd = vscodePath;
const checkout = await runner.execute("git", ["checkout", "tags/1.31.1"]);
const checkout = await runner.execute("git", ["checkout", "tags/1.31.1"]); //TODO: this tag should come from a parameter
Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What do you mean by a parameter?

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I guess he means it shouldn't be hard coded.

if (checkout.exitCode !== 0) {
throw new Error(`Failed to checkout: ${checkout.stderr}`);
}
Expand All @@ -235,6 +235,10 @@ const ensureClean = register("vscode:clean", async (runner) => {

const status = await runner.execute("git", ["status", "--porcelain"]);
if (status.stdout.trim() !== "") {

// inside docker this library throws error on git clean
await runner.execute("rm", ["-rf", "node_modules/spdlog"]);

const clean = await runner.execute("git", ["clean", "-f", "-d", "-X"]);
if (clean.exitCode !== 0) {
throw new Error(`Failed to clean git repository: ${clean.stderr}`);
Expand Down
4 changes: 2 additions & 2 deletions package.json
Expand Up @@ -6,8 +6,8 @@
"description": "Run VS Code remotely.",
"scripts": {
"build:rules": "cd ./rules && tsc -p .",
"packages:install": "cd ./packages && yarn",
"postinstall": "npm-run-all --parallel packages:install build:rules",
"packages:install": "cd ./packages && yarn --frozen-lockfile",
"postinstall": "npm-run-all packages:install build:rules",
"start": "cd ./packages/server && yarn start",
"task": "ts-node -r tsconfig-paths/register build/tasks.ts",
"test": "cd ./packages && yarn test"
Expand Down