Skip to content
This repository has been archived by the owner on Nov 30, 2023. It is now read-only.

Commit

Permalink
add swift dev container
Browse files Browse the repository at this point in the history
  • Loading branch information
jrieken committed Dec 5, 2018
1 parent ef6c064 commit 042e7f1
Show file tree
Hide file tree
Showing 4 changed files with 28 additions and 0 deletions.
6 changes: 6 additions & 0 deletions dev-containers/swift-container/.vscode/devContainer.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
{
"dockerFile": "dev-container.dockerfile",
"extensions": [
"vknabel.vscode-swift-development-environment"
]
}
3 changes: 3 additions & 0 deletions dev-containers/swift-container/.vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,3 @@
{
"swift.path.sourcekite": "/sourcekite/.build/x86_64-unknown-linux/release/sourcekite"
}
13 changes: 13 additions & 0 deletions dev-containers/swift-container/dev-container.dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,13 @@
FROM swift:4.2.1

# Install git
RUN apt-get update && apt-get -y install git

# Install SourceKite, see https://github.com/vknabel/vscode-swift-development-environment/blob/master/README.md#installation
RUN git clone https://github.com/jinmingjian/sourcekite.git
RUN export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:/usr/lib/swift:/usr/lib
RUN ln -s /usr/lib/libsourcekitdInProc.so /usr/lib/sourcekitdInProc
RUN cd sourcekite && swift build -Xlinker -l:sourcekitdInProc -c release

# cleanup
RUN rm -rf /var/lib/apt/lists/*
6 changes: 6 additions & 0 deletions dev-containers/swift-container/main.swift
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@

func say() {
print("Hello, world!");
}

say();

0 comments on commit 042e7f1

Please sign in to comment.