Skip to content

Commit 922a760

Browse files
fix: fix the Dockerfile (#85)
1 parent dce1718 commit 922a760

2 files changed

Lines changed: 18 additions & 6 deletions

File tree

Dockerfile

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,22 +1,28 @@
1-
FROM golang:1.16
1+
FROM golang:1.17
22

33
RUN apt-get update && \
4-
apt-get -y install git unzip build-essential autoconf libtool
4+
apt-get -y install unzip build-essential autoconf libtool
55

66
# Install protobuf from source
7-
RUN git clone --depth=1 https://github.com/protocolbuffers/protobuf.git && \
8-
cd protobuf && \
7+
RUN curl -LjO https://github.com/protocolbuffers/protobuf/archive/refs/tags/v3.17.3.zip && \
8+
unzip v3.17.3.zip && \
9+
cd protobuf-3.17.3 && \
910
./autogen.sh && \
1011
./configure && \
1112
make && \
1213
make install && \
1314
ldconfig && \
1415
make clean && \
1516
cd .. && \
16-
rm -r protobuf
17+
rm -r protobuf-3.17.3 && \
18+
rm v3.17.3.zip
1719

1820
# Go environment variable to enable Go modules
19-
ENV GO111MODULE=on
21+
ENV GO111MODULE=on \
22+
CGO_ENABLED=0 \
23+
GOOS=linux \
24+
GOARCH=amd64
25+
# GOPROXY=https://goproxy.cn,direct
2026

2127
# Get grpc
2228
RUN go get google.golang.org/grpc

README.md

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -78,6 +78,12 @@ docker run -id -p 50051:50051 \
7878
-d casbin/casbin-server
7979
```
8080

81+
If you want to build your own image
82+
83+
```
84+
docker build -f ./Dockerfile -t my-casbin-server-image .
85+
```
86+
8187
## Limitation of ABAC
8288

8389
Casbin-Server also supports the ABAC model as the Casbin library does. You may wonder how Casbin-Server passes the Go structs to the server-side via network? Good question. In fact, Casbin-Server's client dumps Go struct into JSON and transmits the JSON string prefixed by ``ABAC::`` to Casbin-Server. Casbin-Server will recognize the prefix and load the JSON string into a pre-defined Go struct with 11 string members, then pass it to Casbin. So there will be several limitations for Casbin-Server's ABAC compared to Casbin's ABAC:

0 commit comments

Comments
 (0)