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 2c57ad4
Show file tree
Hide file tree
Showing 3 changed files with 78 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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}
Expand Down
53 changes: 53 additions & 0 deletions docker/Dockerfile
Original file line number Diff line number Diff line change
@@ -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
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 2c57ad4

Please sign in to comment.