-
Notifications
You must be signed in to change notification settings - Fork 7
/
Copy pathDockerfile
57 lines (45 loc) · 2.42 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
# Get Go Alpine Base Image from Docker Hub
FROM golang:buster AS builder
#Install JRE for AAPT2
ARG JDK_VERSION=11
RUN apt-get update && \
apt-get install ca-certificates-java openjdk-${JDK_VERSION}-jre-headless -y && \
apt-get install -y --no-install-recommends openjdk-${JDK_VERSION}-jdk && \
apt-get install aapt -y && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* && \
rm -rf /var/cache/oracle-jdk${JDK_VERSION}-installer && \
rm -rf /usr/lib/jvm/java-${JDK_VERSION}-openjdk-amd64/src.zip && \
rm -rf /usr/lib/jvm/java-${JDK_VERSION}-openjdk-amd64/lib/missioncontrol && \
rm -rf /usr/lib/jvm/java-${JDK_VERSION}-openjdk-amd64/lib/visualvm && \
rm -rf /usr/lib/jvm/java-${JDK_VERSION}-openjdk-amd64/lib/*javafx* && \
rm -rf /usr/lib/jvm/java-${JDK_VERSION}-openjdk-amd64/jre/lib/plugin.jar && \
rm -rf /usr/lib/jvm/java-${JDK_VERSION}-openjdk-amd64/jre/lib/ext/jfxrt.jar && \
rm -rf /usr/lib/jvm/java-${JDK_VERSION}-openjdk-amd64/jre/bin/javaws && \
rm -rf /usr/lib/jvm/java-${JDK_VERSION}-openjdk-amd64/jre/lib/javaws.jar && \
rm -rf /usr/lib/jvm/java-${JDK_VERSION}-openjdk-amd64/jre/lib/desktop && \
rm -rf /usr/lib/jvm/java-${JDK_VERSION}-openjdk-amd64/jre/plugin && \
rm -rf /usr/lib/jvm/java-${JDK_VERSION}-openjdk-amd64/jre/lib/deploy* && \
rm -rf /usr/lib/jvm/java-${JDK_VERSION}-openjdk-amd64/jre/lib/*javafx* && \
rm -rf /usr/lib/jvm/java-${JDK_VERSION}-openjdk-amd64/jre/lib/*jfx* && \
rm -rf /usr/lib/jvm/java-${JDK_VERSION}-openjdk-amd64/jre/lib/amd64/libdecora_sse.so && \
rm -rf /usr/lib/jvm/java-${JDK_VERSION}-openjdk-amd64/jre/lib/amd64/libprism_*.so && \
rm -rf /usr/lib/jvm/java-${JDK_VERSION}-openjdk-amd64/jre/lib/amd64/libfxplugins.so && \
rm -rf /usr/lib/jvm/java-${JDK_VERSION}-openjdk-amd64/jre/lib/amd64/libglass.so && \
rm -rf /usr/lib/jvm/java-${JDK_VERSION}-openjdk-amd64/jre/lib/amd64/libgstreamer-lite.so && \
rm -rf /usr/lib/jvm/java-${JDK_VERSION}-openjdk-amd64/jre/lib/amd64/libjavafx*.so && \
rm -rf /usr/lib/jvm/java-${JDK_VERSION}-openjdk-amd64/jre/lib/amd64/libjfx*.so
## Install Ripgrep
RUN apt-get update && \
apt-get install -y --no-install-recommends ripgrep && \
apt-get clean && \
rm -rf /var/lib/apt/lists/*
WORKDIR /app
COPY . .
RUN go mod download
ENV GOARCH=arm64
ENV GOOS=linux
ENV CGO_ENABLED=0
RUN go build -v -x -o morf .
EXPOSE 8888
ENTRYPOINT ["./morf" , "server" , "-p" , "8888"]