Giter Site home page Giter Site logo

Comments (6)

michaellilltokiwa avatar michaellilltokiwa commented on July 17, 2024 3

Possible workaround is to extract the vsix to the extensions directory directly like so:

FROM gitpod/openvscode-server:latest
USER root

RUN apt-get update && apt-get -y install zip
COPY fuzion-lang-0.1.0.vsix /home/
RUN mkdir /home/openvscode-server-v1.60.2-linux-x64/extensions/fuzion/
RUN unzip /home/fuzion-lang-0.1.0.vsix "extension/*" -d /home/openvscode-server-v1.60.2-linux-x64/extensions/fuzion/

USER openvscode-server

from openvscode-server.

badp avatar badp commented on July 17, 2024

Seconded, we're currently shipping Eclipse Theia as part of our development environment docker images with a list of plugins as described here so our users don't have to install pyright etc. themselves. However, Theia doesn't ship with an extension store for users to fiddle with (= install, uninstall, upgrade) extensions and that would be a nice feature to add to our offering. (We also have no interest in writing our own Theia extensions.)

from openvscode-server.

andymac4182 avatar andymac4182 commented on July 17, 2024

We are looking at rolling this out as some workstations for some of our team. This would be a massive help.

I am curious how this would work mixing extensions installed in docker vs ones that are updated or installed into the workspace.

from openvscode-server.

oldirtybasti avatar oldirtybasti commented on July 17, 2024

I copy them to the workspace to get rid of any version number dependencies. There also is a tool called lastversion, which gets up to date version numbers from github:

RUN export EXTENSION=redhat.java-$(lastversion microsoft/vscode-java-test) && \
    lastversion --assets microsoft/vscode-java-test -d /home/workspace/.opencode-server/extensions/$EXTENSION.vsix && \
    mkdir -p /home/workspace/.opencode-server/extensions/$EXTENSION && unzip /home/workspace/.opencode-server/extensions/$EXTENSION.vsix -d /home/workspace/.opencode-server/extensions/$EXTENSION && mv /home/workspace/.opencode-server/extensions/$EXTENSION/extension/* /home/workspace/.opencode-server/extensions/$EXTENSION

For tools not releasing their vsix via github, I copy them directly from the build environment.

from openvscode-server.

deviantony avatar deviantony commented on July 17, 2024

Allright so I've been fighting with this for a bit of time.

@michaellilltokiwa 's example did not work for me.

I went with @oldirtybasti's suggestion, without using lastversion and finally settled on the following solution to install extensions at build time:

# First, you'll need to retrieve the unique identifier associated to the extension
# It can be found on VSCode extension marketplace: https://marketplace.visualstudio.com/items?itemName=ms-python.python
# The unique identifier for this extension is: ms-python.python

# A unique identifier is usually defined using the following format PUBLISHER.PACKAGE

# Just update the EXT_PUBLISHER and EXT_PACKAGE environment variables appropriately.

## Python extension ID: ms-python.python
RUN EXT_PUBLISHER=ms-python EXT_PACKAGE=python && \
    mkdir -pv "/home/workspace/.openvscode-server/extensions/${EXT_PUBLISHER}.${EXT_PACKAGE}" && \
    curl -sSL "https://${EXT_PUBLISHER}.gallery.vsassets.io/_apis/public/gallery/publisher/${EXT_PUBLISHER}/extension/${EXT_PACKAGE}/latest/assetbyname/Microsoft.VisualStudio.Services.VSIXPackage" | bsdtar xvf - --strip-components=1 -C "/home/workspace/.openvscode-server/extensions/${EXT_PUBLISHER}.${EXT_PACKAGE}"

Make sure that you have both curl and bsdtar binaries available in your image for the commands above to work.

This will install the latest version of the extension of your choice.

EDIT: The code --install-extension CLI approach would be the best indeed but I'm not sure if that's going to be possible as I think we'd need to have the VSCode server running first before you could use it to install extensions.

from openvscode-server.

akosyakov avatar akosyakov commented on July 17, 2024

When you start a server with server.sh you can pass --install-extension or --install-builtin-extension.

from openvscode-server.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.