-
-
Notifications
You must be signed in to change notification settings - Fork 2k
Expand file tree
/
Copy pathDockerfile
More file actions
25 lines (18 loc) · 720 Bytes
/
Dockerfile
File metadata and controls
25 lines (18 loc) · 720 Bytes
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
FROM gcc:11.5.0 AS builder
RUN apt-get update && apt-get install cmake -y
WORKDIR /MMKV
COPY . .
## 设置环境变量
#ENV CGO_ENABLED='1'
#ENV CGO_CFLAGS='-static -O2 -g'
#ENV CGO_LDFLAGS='-static -O2 -g'
WORKDIR /MMKV/POSIX/golang
RUN mkdir -p build && cd build && rm -rf ./* && \
cmake .. -DCMAKE_INSTALL_PREFIX=. \
-DCMAKE_BUILD_TYPE=Release && \
make -j8 install
RUN uname -a > /MMKV/POSIX/golang/build/tencent.com/build_info.txt 2>&1 && \
gcc -v >> /MMKV/POSIX/golang/build/tencent.com/build_info.txt 2>&1 && \
cmake --version >> /MMKV/POSIX/golang/build/tencent.com/build_info.txt 2>&1
FROM scratch AS export-stage
COPY --from=builder /MMKV/POSIX/golang/build/tencent.com /tencent.com