forked from eclipse-theia/theia-ide
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
185 additions
and
3 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
File renamed without changes.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,122 @@ | ||
# Swift requires builder and runtime images overwritten by workflow | ||
ARG BUILDER_IMAGE=swift:focal | ||
ARG RUNTIME_IMAGE=swift:focal | ||
|
||
# Load the base-ide image, only copy from here | ||
FROM ghcr.io/ls1intum/theia/base as base-ide | ||
|
||
# Load the plugin image, only copy from here | ||
FROM node:18-bullseye as plugin-image | ||
|
||
WORKDIR /home/theia | ||
|
||
# Configure to skip download of puppeteer | ||
ENV PUPPETEER_SKIP_DOWNLOAD true | ||
|
||
# Copy required configuration files | ||
COPY yarn.lock yarn.lock | ||
|
||
# Copy image specific files - this should overwrite the default files from the repository | ||
# WARNING: This needs to be adapted to the specific image | ||
COPY images/swift/package.json . | ||
|
||
# Remove unnecesarry files for the browser application | ||
# Download plugins and build application production mode | ||
# Use yarn autoclean to remove unnecessary files from package dependencies | ||
RUN yarn --pure-lockfile && \ | ||
yarn download:plugins | ||
|
||
# Prepare Swift Application | ||
# Adapted from https://github.com/ls1intum/artemis-swift-swiftlint-docker/blob/main/Dockerfile | ||
FROM ${BUILDER_IMAGE} as builder | ||
|
||
RUN apt-get update && apt-get install -y \ | ||
libcurl4-openssl-dev \ | ||
libxml2-dev \ | ||
&& rm -r /var/lib/apt/lists/* | ||
|
||
RUN git clone https://github.com/realm/SwiftLint.git | ||
WORKDIR /SwiftLint | ||
|
||
# Default SwiftLint version - will be overwritten by the GH action | ||
ARG SWIFTLINT_VERSION=0.53.0 | ||
RUN git checkout ${SWIFTLINT_VERSION} | ||
|
||
RUN swift package update | ||
ARG SWIFT_FLAGS="-c release -Xswiftc -static-stdlib -Xlinker -lCFURLSessionInterface -Xlinker -lCFXMLInterface -Xlinker -lcurl -Xlinker -lxml2 -Xswiftc -I. -Xlinker -fuse-ld=lld -Xlinker -L/usr/lib/swift/linux" | ||
RUN swift build ${SWIFT_FLAGS} --product swiftlint | ||
RUN mkdir -p /executables | ||
RUN install -v `swift build ${SWIFT_FLAGS} --show-bin-path`/swiftlint /executables | ||
|
||
# Assemble the application | ||
FROM ${RUNTIME_IMAGE} as final-ide | ||
|
||
# Required by Swift | ||
RUN apt-get update && apt-get install -y \ | ||
libcurl4 \ | ||
libxml2 \ | ||
&& rm -r /var/lib/apt/lists/* | ||
|
||
WORKDIR /home/theia | ||
|
||
# Copy IDE files | ||
COPY --from=base-ide /home/theia/applications/browser/lib/backend /home/theia/applications/browser/lib/backend | ||
COPY --from=base-ide /home/theia/applications/browser/ /home/theia/applications/browser/ | ||
|
||
# Copy plugins | ||
COPY --from=base-ide /home/theia/plugins /home/theia/plugins | ||
COPY --from=plugin-image /home/theia/plugins /home/theia/plugins | ||
|
||
# Create theia user and directories | ||
# Application will be copied to /home/theia | ||
# Default workspace is located at /home/project | ||
RUN adduser --system --group theia | ||
RUN chmod g+rw /home && \ | ||
mkdir -p /home/project && \ | ||
chown -R theia:theia /home/theia && \ | ||
chown -R theia:theia /home/project | ||
|
||
# Copy dependencies from builder image | ||
COPY --from=builder /usr/lib/libsourcekitdInProc.so /usr/lib | ||
COPY --from=builder /usr/lib/swift/linux/libBlocksRuntime.so /usr/lib | ||
COPY --from=builder /usr/lib/swift/linux/libdispatch.so /usr/lib | ||
COPY --from=builder /usr/lib/swift/linux/libswiftCore.so /usr/lib | ||
COPY --from=builder /executables/* /usr/bin | ||
|
||
# Copy node from plugin-image as it is required for Theia | ||
COPY --from=plugin-image /usr/local/bin/node /usr/local/bin/ | ||
COPY --from=plugin-image /usr/local/lib/node_modules/ /usr/local/lib/node_modules/ | ||
COPY --from=plugin-image /usr/local/lib/node_modules/ /home/theia/node_modules/ | ||
COPY --from=plugin-image /home/theia/node_modules/ /home/theia/node_modules/ | ||
|
||
# Create a symbolic link to the node_modules directory | ||
RUN ln -s /home/theia/node_modules /home/theia/applications/browser/node_modules.asar | ||
|
||
# Install required tools for tool creation and terminal usage: wget, apt-transport-https, update & upgrade packages, bash | ||
RUN apt-get update && \ | ||
apt-get install -y wget apt-transport-https bash && \ | ||
apt-get upgrade -y | ||
|
||
# Specify default shell for Theia and the Built-In plugins directory | ||
ENV SHELL=/bin/bash \ | ||
THEIA_DEFAULT_PLUGINS=local-dir:/home/theia/plugins | ||
|
||
# Use installed git instead of dugite | ||
ENV USE_LOCAL_GIT true | ||
|
||
# Print Installed Swift & SwiftLint Version | ||
RUN swift --version | ||
RUN swiftlint version | ||
|
||
ENV HOME /home/theia | ||
EXPOSE 3000 | ||
|
||
# Switch to Theia user | ||
USER theia | ||
WORKDIR /home/theia/applications/browser | ||
|
||
# Launch the backend application via node | ||
ENTRYPOINT [ "node", "/home/theia/applications/browser/lib/backend/main.js" ] | ||
|
||
# Arguments passed to the application | ||
CMD [ "/home/project", "--hostname=0.0.0.0" ] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,43 @@ | ||
{ | ||
"private": true, | ||
"version": "1.50.100", | ||
"license": "MIT", | ||
"author": "Rob Moran <[email protected]>", | ||
"homepage": "https://github.com/eclipse-theia/theia-blueprint#readme", | ||
"bugs": { | ||
"url": "https://github.com/eclipse-theia/theia/issues" | ||
}, | ||
"repository": { | ||
"type": "git", | ||
"url": "git+https://github.com/eclipse-theia/theia-blueprint.git" | ||
}, | ||
"engines": { | ||
"yarn": ">=1.7.0 <2", | ||
"node": ">=12.14.1" | ||
}, | ||
"devDependencies": { | ||
"@theia/cli": "1.50.1", | ||
"node-pty": "1.0.0" | ||
}, | ||
"scripts": { | ||
"clean": "lerna run clean && rimraf node_modules", | ||
"build:extensions": "lerna run --scope=\"theia-ide*ext\" build", | ||
"download:plugins": "theia download:plugins --rate-limit=15 --parallel=false --ignore-errors" | ||
}, | ||
"theiaPluginsDir": "plugins", | ||
"theiaPlugins": { | ||
"swift-language-basics": "https://open-vsx.org/api/vscode/swift/1.88.1/file/vscode.swift-1.88.1.vsix", | ||
"swift": "https://open-vsx.org/api/sswg/swift-lang/1.10.2/file/sswg.swift-lang-1.10.2.vsix", | ||
"swiftlint-vsc": "https://open-vsx.org/api/vknabel/vscode-swiftlint/1.8.4/file/vknabel.vscode-swiftlint-1.8.4.vsix" | ||
}, | ||
"theiaPluginsExcludeIds": [ | ||
"ms-vscode.js-debug-companion", | ||
"VisualStudioExptTeam.vscodeintellicode", | ||
"vscode.builtin-notebook-renderers", | ||
"vscode.extension-editing", | ||
"vscode.github", | ||
"vscode.github-authentication", | ||
"vscode.ipynb", | ||
"vscode.microsoft-authentication" | ||
] | ||
} |