forked from IOActive/laf
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile
31 lines (22 loc) · 816 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:latest
RUN apt-get update && apt-get install -y python3-pip
# Set the working directory to /app
WORKDIR /root/app
ENV PYTHONPATH="/root/app" \
GOPATH="/root/go"
# Add the python requirements first in order to docker cache them
ADD ./requirements.txt /root/app/requirements.txt
# Install any needed packages specified in requirements.txt
RUN pip3 install --trusted-host pypi.python.org -r requirements.txt
# Copy the current directory contents into the container at /app
ADD . /root/app/
# Install go dependencies
RUN go get -d ./...
# Redirect python command to python3
RUN rm /usr/bin/python
RUN ln -s /usr/bin/python3 /usr/bin/python
# Compile go library
WORKDIR /root/app/lorawanwrapper/utils
RUN go build -o lorawanWrapper.so -buildmode=c-shared *.go
WORKDIR /root/app
CMD sleep infinity