Skip to content

Commit c4cb596

Browse files
committed
Use a multi-stage Docker build
Build a slim image by only including the installed and packaged language server in the final image.
1 parent 15cc8c0 commit c4cb596

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

Dockerfile

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,16 @@
11
# Running this container will start a language server that listens for TCP connections on port 2088
22
# Every connection will be run in a forked child process
33

4-
# Please note that before building the image, you have to build the language server with `./gradlew :server:installDist`
4+
FROM alpine:3.10 AS builder
5+
6+
WORKDIR /kotlin-language-server
7+
COPY . .
8+
RUN ./gradlew :server:installDist
59

610
FROM openjdk:10
711

812
WORKDIR /
9-
COPY server/build/install/server .
13+
COPY --from=builder /kotlin-language-server/server/build/install/server .
1014

1115
EXPOSE 2088
1216

0 commit comments

Comments
 (0)