-
Notifications
You must be signed in to change notification settings - Fork 5.9k
Docker issues #104
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
Docker issues #104
Changes from 19 commits
4f0dbd4
f1ddb86
c0c7de8
b62306e
3396cff
ec2518a
7e44a39
0c442f2
3128602
4f5e9ab
c8f3aa5
035e434
f1dc057
bbf610d
994d5fd
3f6aa4c
b935418
b093abd
a9b825b
a4f9e53
5ba803f
9982968
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -1 +1,12 @@ | ||||||
.git | ||||||
.gitignore | ||||||
Dockerfile | ||||||
lib | ||||||
node_modules | ||||||
**/dist | ||||||
**/out | ||||||
.DS_Store | ||||||
*.DS_Store | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. why an additional starred .DS_Store?
Suggested change
|
||||||
release | ||||||
**/yarn-error.log | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Shouldn't any logs be ignored?
Suggested change
|
||||||
**/node_modules |
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
|
@@ -4,3 +4,4 @@ dist | |||||
out | ||||||
.DS_Store | ||||||
release | ||||||
yarn-error.log | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Same as with .dockerignore, all log-files should be ignored
Suggested change
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,32 +1,45 @@ | ||
FROM node:8.15.0 | ||
|
||
# Install VS Code's deps. These are the only two it seems we need. | ||
RUN apt-get update && apt-get install -y \ | ||
libxkbfile-dev \ | ||
libsecret-1-dev | ||
|
||
# Ensure latest yarn. | ||
RUN npm install -g [email protected] | ||
|
||
WORKDIR /src | ||
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. | ||
RUN yarn && yarn task build:server:binary | ||
# This takes ages and always dies in the end. :( | ||
# RUN yarn --frozen-lockfile && yarn task build:server:binary | ||
|
||
# Make the debugging easier - and the rebuilds faster | ||
# and our life happier lets break up the build to sequential parts | ||
RUN yarn --frozen-lockfile | ||
|
||
RUN yarn task vscode:install | ||
RUN yarn task build:copy-vscode | ||
RUN yarn task build:web | ||
RUN yarn task build:bootstrap-fork | ||
RUN yarn task build:default-extensions | ||
RUN yarn task build:server:bundle | ||
RUN yarn task build:app:browser | ||
RUN yarn task build:server:binary:package | ||
zerdos marked this conversation as resolved.
Show resolved
Hide resolved
|
||
|
||
# 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-x64 /usr/local/bin/code-server | ||
EXPOSE 8443 | ||
|
||
RUN apt-get update && apt-get install -y \ | ||
openssl \ | ||
net-tools | ||
|
||
RUN apt-get install -y locales && \ | ||
locale-gen en_US.UTF-8 | ||
|
||
# We unfortunately cannot use update-locale because docker will not use the env variables | ||
# 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 |
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -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", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I want a rationale why the parallel flag have to be removed. |
||
"start": "cd ./packages/server && yarn start", | ||
"task": "ts-node -r tsconfig-paths/register build/tasks.ts", | ||
"test": "cd ./packages && yarn test" | ||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -14,6 +14,7 @@ | |
}, | ||
"devDependencies": { | ||
"@types/tar-stream": "^1.6.0", | ||
"cross-env": "^5.2.0", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. @kylecarbs why wasn't this here already? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I've seen a commit yesterday, which removed the global instal of this packet from travis. There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This should be fixed now (71abb8d); the scripts directly reference the |
||
"vscode-textmate": "^4.0.1" | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Why do we want to not put node_modules into the container?
Right now yarn doesn't use it as a cache but it could in the future. See the comment in the Dockerfile.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I guess we can add it back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
https://medium.com/@rdsubhas/docker-for-development-common-problems-and-solutions-95b25cae41eb
In linux we have linux binaries, on mac we have mac binaries, on windows we have exe files.
NPM is a hot mess, so node_modules should be git + docker ignored.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Are you sure about this? I thought
node_modules
only contained source code? Not actual binaries.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@zerdos is right. Check the folder
node_modules/.bin/
. There are modules that build executables in there (thenode-sass
package is one that comes to mind. I don't think code-server uses it, but there are many other examples).