Skip to content

Commit

Permalink
Add rocky linux docker
Browse files Browse the repository at this point in the history
  • Loading branch information
fantasy-peak committed May 14, 2024
1 parent 7afb4c5 commit 709b735
Show file tree
Hide file tree
Showing 3 changed files with 81 additions and 0 deletions.
7 changes: 7 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -33,6 +33,12 @@ xmake install -o . --file=./test_xmake.lua
./bin/coro_frpc_bi
```

## Docker compilation environment
```
git clone https://github.com/fantasy-peak/frpc.git
cd frpc && cd docker && make
```

## Type Mapping
| frpc type | c++ type | frpc type | c++ type |
|---------|--------------------|---------|--------------------|
Expand Down Expand Up @@ -79,6 +85,7 @@ HelloWorldApi:
inputs:
bank_info: {type: BankInfo}
blance: {type: u64}
date: {type: DateTime} # frpc DateTime type
outputs:
reply: {type: string}
info: {type: Info}
Expand Down
50 changes: 50 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,50 @@
ARG ROCKY_LINUX_VERSIONS

FROM rockylinux:${ROCKY_LINUX_VERSIONS}

SHELL ["/bin/bash", "-c"]

RUN update-ca-trust; \
rm -f /etc/localtime; \
ln -s /usr/share/zoneinfo/Asia/Tokyo /etc/localtime; \
# dnf update -y; \
dnf install -y \
autoconf \
automake \
bison \
bzip2 \
cmake \
git \
libtool \
make \
openssh.x86_64 \
openssh-clients \
patch \
rpm-build \
tar \
wget \
libuuid-devel.x86_64 \
clang-tools-extra.x86_64 \
gcc-toolset-13* \
which \
yum-utils; \
dnf clean all

RUN echo "source /opt/rh/gcc-toolset-13/enable" >> ~/.bashrc

WORKDIR /root

RUN source ~/.bashrc \
&&curl -kfsSL https://xmake.io/shget.text | bash -s v2.9.1 \
&& echo "export XMAKE_ROOT=y" >> ~/.bashrc \
&& echo "source ~/.xmake/profile" >> ~/.bashrc

RUN source ~/.bashrc \
&& xmake --version \
&& git clone https://github.com/fantasy-peak/frpc.git \
&& cd frpc \
&& xmake build -v -y --file=./xmake.lua \
&& xmake install -o . --file=./xmake.lua \
&& ./bin/frpc -f ./config/config.yaml -t ./template/cpp -o ./out -w ./template/web --auto_sort=0 --debug=0 \
&& xmake build -v -y --file=./test_xmake.lua \
&& xmake install -o . --file=./test_xmake.lua
24 changes: 24 additions & 0 deletions docker/makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
ROCKY_LINUX_VERSIONS := 8.9.20231119
REPOSITORY_NAME := rockylinux-frpc
CONTAINER := "rockylinux-frpc"

.PONY: $(ROCKY_LINUX_VERSIONS)
default: $(ROCKY_LINUX_VERSIONS)


$(ROCKY_LINUX_VERSIONS):
@echo "----(${REPOSITORY_NAME}:${ROCKY_LINUX_VERSIONS})"
# docker build --progress=plain --no-cache --build-arg ROCKY_LINUX_VERSIONS=$@ -t ${REPOSITORY_NAME}:$@ .
docker build --progress=plain --build-arg ROCKY_LINUX_VERSIONS=$@ -t ${REPOSITORY_NAME}:$@ .

del:
docker rm -f ${CONTAINER}
docker rmi -f ${REPOSITORY_NAME}:${ROCKY_LINUX_VERSIONS}

run:
docker run -it -v /var/run/docker.sock:/var/run/docker.sock --net=host --privileged --name ${CONTAINER} ${REPOSITORY_NAME}:${ROCKY_LINUX_VERSIONS}

login:
docker start $(CONTAINER)
docker exec -i -t $(CONTAINER) /bin/bash

0 comments on commit 709b735

Please sign in to comment.