forked from solita/clamav-rest
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathDockerfile
40 lines (31 loc) · 936 Bytes
/
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
# build stage 0 : generate /build/target/clamav-rest-1.0.2.jar
FROM maven as builder
RUN apt-get upgrade -y && update-ca-certificates
RUN mkdir -p /build
WORKDIR /build
COPY img /build/img/
COPY pom.xml /build/
COPY src /build/src/
RUN mvn -Dmaven.test.skip=true package
# MAIN build stage
FROM centos:7
# MAINTAINER lokori <[email protected]>
RUN yum update -y && \
yum install -y java-1.8.0-openjdk-headless java-1.8.0-openjdk-devel && \
yum clean all && \
rm -rf /var/cache/yum
# Set environment variables.
ENV HOME /root
# Get the JAR file
CMD mkdir -p /var/clamav-rest
COPY --from=builder /build/target/clamav-rest-1.0.2.jar /var/clamav-rest/
# Define working directory.
WORKDIR /var/clamav-rest/
# Open up the server
EXPOSE 8080
ADD bootstrap.sh /
# handle windows \r's
RUN tr -d '\r' < /bootstrap.sh > .tmp && \
mv .tmp /bootstrap.sh && \
chmod a+x /bootstrap.sh
ENTRYPOINT ["/bootstrap.sh"]