diff --git a/README.md b/README.md index 5b1e04b..7f52814 100644 --- a/README.md +++ b/README.md @@ -79,6 +79,7 @@ HelloWorldApi: inputs: bank_info: {type: BankInfo} blance: {type: u64} + date: {type: DateTime} # frpc DateTime type outputs: reply: {type: string} info: {type: Info} diff --git a/docker/Dockerfile b/docker/Dockerfile new file mode 100644 index 0000000..c95ac65 --- /dev/null +++ b/docker/Dockerfile @@ -0,0 +1,53 @@ +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 +RUN source /opt/rh/gcc-toolset-13/enable && g++ -v + +WORKDIR /root + +RUN source /opt/rh/gcc-toolset-13/enable \ + &&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 /opt/rh/gcc-toolset-13/enable \ + && export XMAKE_ROOT=y \ + && source ~/.xmake/profile \ + && 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 diff --git a/docker/makefile b/docker/makefile new file mode 100644 index 0000000..9347d52 --- /dev/null +++ b/docker/makefile @@ -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 +