This repository has been archived by the owner on Sep 18, 2019. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Dockerfile
52 lines (45 loc) · 1.53 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
############################################################
# A Dockerfile used to create a java-stix build container
#
# Copyright (c) 2015, The MITRE Corporation. All rights reserved.
# See LICENSE for complete terms.
#
# @author nemonik (Michael Joseph Walsh <[email protected]>)
#
# WHAT TO DO:
#
# If you have Docker installed, from the root of the project run
# the following to create a container image for this Dockerfile via:
#
# docker build -t stix/validator .
#
# With the image is built, start a container with:
#
# docker run -d -p 8080:8080 stix/validator
#
# If you're using boot2docker, you will need to access via VM’s
# host only interface IP address:
#
# boot2docker ip
#
# And then point your browser to http://$(boot2docker ip):8080
# vice https://localhost:8080
############################################################
# Set base image
FROM java:8
# File Maintainer
MAINTAINER STIX Project, The MITRE Corporation
# Update
RUN apt-get -y update
# Cannot run bower as root so we will need to install as another user
RUN adduser --disabled-password --gecos '' stix && adduser stix sudo && echo '%sudo ALL=(ALL) NOPASSWD:ALL' >> /etc/sudoers
# Copy java-stix-validator project into the container
WORKDIR /home/stix
COPY . java-stix-validator
RUN chown -R stix java-stix-validator
WORKDIR /home/stix/java-stix-validator
# Build the project
RUN su stix -c './gradlew stage'
# Expose and start the validator microservice
EXPOSE 8080
CMD ["/home/stix/java-stix-validator/build/install/java-stix-validator/bin/java-stix-validator"]