-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathDockerfile
More file actions
73 lines (58 loc) · 1.66 KB
/
Copy pathDockerfile
File metadata and controls
73 lines (58 loc) · 1.66 KB
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
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
FROM golang:1.15 AS builder
# optional create user
# RUN mkdir /app
# ADD . /app/
# WORKDIR /app
# RUN go build -o main .
# RUN adduser -S -D -H -h /app appuser
# USER appuser
# install openssl and libgmp and libcrypto++
RUN apt update && apt-get install -y \
openssl \
libssl-dev \
libgmp3-dev \
libcrypto++-dev \
libcrypto++-doc \
libcrypto++-utils \
&& rm -rf /var/lib/apt/lists/*
# setup the GOBIN environment
ENV GOBIN /go/bin
ENV PATH="${GOBIN}:${PATH}"
RUN echo "export PATH=$PATH" > /etc/environment
# set the work directory
WORKDIR /go/src/app/
# make mdencode
RUN mkdir mdencode
# change to the app directory
WORKDIR /go/src/app/mdencode
# Copy go mod and sum files
COPY go.mod go.sum ./
# Download all dependencies. Dependencies will be cached if the go.mod and go.sum files are not changed
RUN go mod download
# Copy the source from the current directory to the Working Directory inside the container
COPY . .
# check the mdencode source directory
RUN ls -lha /go/src/app/mdencode
# change to the build /go/src/app/mdencode/code
# WORKDIR /go/src/app/mdencode/code/testdecode_cpp/external/fnv
# RUN make install
# RUN make
# change to the build directory
WORKDIR /go/src/app/mdencode/build
# run the make build for mdencode and mdzip
RUN make mdencode
RUN make mdzip
RUN make buildcpp
# check the mdencode and mdzip binary execs
RUN mdsig
RUN mdencode
# check the mdzip go binary execs
RUN mdzip
RUN mdunzip
# check the cpp binary
RUN ls -lha
RUN /go/src/app/mdencode/build/mdzipcpp
RUN /go/src/app/mdencode/build/mdunzipcpp
RUN /go/src/app/mdencode/build/mdzipsip47
RUN /go/src/app/mdencode/build/mdunzipsip47
RUN /go/src/app/mdencode/build/mdtest