-
Notifications
You must be signed in to change notification settings - Fork 5.9k
How to install extensions while building docker image #484
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
Comments
ciao @yamajik have a look at our Dockerfile at https://github.com/monostream/code-server/blob/develop/Dockerfile at the end of the file. We download the VSIX from the marketplace and extract it to the extensions folder. make sure you use bsdtar for this cheers |
ENV HOME_DIR "/root"
# Setup User Visual Studio Code Extentions
ENV CODE_SERVER_EXTENSIONS "${HOME_DIR}/.local/share/code-server/extensions"
# Setup User Visual Studio Code Workspace Storage
ENV CODE_SERVER_WORKSPACESTORAGE "${HOME_DIR}/.code-server/User/workspaceStorage"
# Mkdir Workspace Storage
RUN mkdir -p ${CODE_SERVER_WORKSPACESTORAGE}
# Setup Python Extension
RUN mkdir -p ${CODE_SERVER_EXTENSIONS}/python \
&& curl -JLs --retry 5 https://marketplace.visualstudio.com/_apis/public/gallery/publishers/ms-python/vsextensions/python/latest/vspackage | bsdtar --strip-components=1 -xf - -C ${CODE_SERVER_EXTENSIONS}/python extension bsdtar: Error opening archive: Unrecognized archive format whats wrong? |
@yamajik The official VSCode extensions are not distributed in Tar format, they are Zips. |
@yamajik i recognized this as well from time a repeating docker build usually works... and since docker is caching the layers, it takes not as long as the first time |
i have
find it too and terriable it is. |
this is the error of a failed download:
|
@adrianliechti That's because the Microsoft VSCode Extension Marketplace API is not public. Using it in this way is against their TOS. |
Can now be done reasonably cleanly with changes from #504. There are no docs on this yet afaik. |
@foresthoffman are you sure? I ask because if you navigate to https://marketplace.visualstudio.com/items?itemName=ms-vscode.csharp for example, you find on the right side a "Download Extension" link in the section of "Resources"... looks pretty public to me... |
@yamajik This is expected. Please see my comment to @adrianliechti below. @lucacasonato Yes, thank you. That addition to the CLI will make this much more achievable. @adrianliechti I am absolutely certain. Using an HTTP(S) client to access the Microsoft servers and download an extension is completely different from using an API with documented endpoints, required request values, and expected response values.
Since the original question was regarding installing extensions via the CLI, and #504 has fixed this, i'll be closing this issue. Thank you. |
Could I install extensions over cli? Or during docker image building?
The text was updated successfully, but these errors were encountered: