forked from big-data-europe/mu-har-transformation-service
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
31 lines (24 loc) · 1002 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
FROM golang:buster AS build
RUN apt-get update && apt-get install -y libpcap-dev jq
RUN wget https://github.com/colinnewell/pcap2har-go/archive/master.tar.gz
RUN mkdir -p /src/pcap2har-go && tar xzf master.tar.gz && cd pcap2har-go-master && mv go.mod go.sum cmd internal test /src/pcap2har-go
ARG VERSION master
WORKDIR /src/pcap2har-go
RUN go build -o pcap2har -ldflags "-X main.Version=$VERSION" cmd/pcap2har/*.go
FROM python:2.7
ENV PCAP_READ_DIR "pcap/"
ENV HAR_OUTPUT_DIR "har/"
ENV BU_DIR "/app/backups/"
ENV CONTAINER_DATA_DIR 'containers/'
ENV CONTAINER_DATA_FILE 'containers.json'
ENV MU_SPARQL_ENDPOINT "http://database:8890/sparql"
ENV SLEEP_PERIOD '30'
ENV KEEP_BASE_HAR "true"
RUN mkdir /app
WORKDIR /app
COPY requirements.txt /app/requirements.txt
RUN if [ -f requirements.txt ]; then pip install -r requirements.txt; fi
RUN apt-get update && apt-get install -y libpcap-dev
COPY --from=build /src/pcap2har-go/pcap2har /pcap2har
COPY . /app
CMD ["python", "pcap-har-watcher.py"]