diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index fd00fbd81f..9a0a448348 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -81,4 +81,24 @@ jobs: https://raw.githack.com/jaywcjlove/linux-command/${{ steps.changelog.outputs.gh-pages-short-hash }}/index.html - run: npm install @jsdevtools/npm-publish -g - - run: npm-publish --token="${{ secrets.NPM_TOKEN }}" ./package.json \ No newline at end of file + - run: npm-publish --token="${{ secrets.NPM_TOKEN }}" ./package.json + + - run: rm -rf .deploy/linux-command.docset.zip + + # Create Docker Image + - name: Docker login + if: steps.create_tag.outputs.successful + run: docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_PASSWORD }} + + - name: Build linux-command image + if: steps.create_tag.outputs.successful + run: docker image build -t linux-command . + + - name: Tags & Push image + if: steps.create_tag.outputs.successful + run: | + echo "outputs.tag - ${{ steps.changelog.outputs.version }}" + docker tag linux-command ${{ secrets.DOCKER_USER }}/linux-command:${{steps.changelog.outputs.version}} + docker tag linux-command ${{ secrets.DOCKER_USER }}/linux-command:latest + docker push ${{ secrets.DOCKER_USER }}/linux-command:${{steps.changelog.outputs.version}} + docker push ${{ secrets.DOCKER_USER }}/linux-command:latest \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000000..36222a3f97 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,10 @@ +FROM nginx:1-alpine + +ENV APPDIR /usr/share/nginx/html +RUN mkdir -p $APPDIR + +RUN cat /etc/nginx/conf.d/default.conf + +WORKDIR $APPDIR + +ADD ./.deploy /usr/share/nginx/html \ No newline at end of file diff --git a/README.md b/README.md index 55535c487e..5b1bdcdc84 100644 --- a/README.md +++ b/README.md @@ -14,7 +14,7 @@ 当前仓库搜集了 570 多个 Linux 命令,是一个非盈利性的仓库,生成了一个 web 网站方便使用,目前网站没有任何广告,内容包含 Linux 命令手册、详解、学习,内容来自网络和网友的补充,非常值得收藏的 Linux 命令速查手册。版权归属原作者,对任何法律问题及风险不承担任何责任,没有任何商业目的,如果认为侵犯了您的版权,请来信告知。我不能完全保证内容的正确性。通过使用本站内容带来的风险与我无关。当使用本站时,代表您已接受了本站的使用条款和隐私条款。 -[Web](#web-版本) | [微信小程序](#微信小程序版本) | [Dash](#dash-版本) | [Raycast](#raycast-版本) | [Alfred](#alfred-版本) | [KDE/Krunner](https://github.com/roachsinai/krunner-linuxcommands) | [Android](https://github.com/Ernest-su/LinuxCmd.git) | [Mac/Win/Linux](https://github.com/haloislet/linux-command) | [Chrome Plugin](#chrome-插件) | [命令行工具](#命令行工具) +[Web](#web-版本) | [微信小程序](#微信小程序版本) | [Dash](#dash-版本) | [Raycast](#raycast-版本) | [Alfred](#alfred-版本) | [KDE/Krunner](https://github.com/roachsinai/krunner-linuxcommands) | [Android](https://github.com/Ernest-su/LinuxCmd.git) | [Mac/Win/Linux](https://github.com/haloislet/linux-command) | [Chrome Plugin](#chrome-插件) | [命令行工具](#命令行工具) | [Docker](#docker) ### Web 版本 @@ -115,6 +115,28 @@ - [`@chenjiandongx/pls`](https://github.com/chenjiandongx/pls) Golang 版 [#129](https://github.com/jaywcjlove/linux-command/issues/129),由 [**@陈键冬**](https://github.com/chenjiandongx) 提供。 +## Docker + +[![Docker Image Version (latest by date)](https://img.shields.io/docker/v/wcjiang/linux-command)](https://hub.docker.com/r/wcjiang/linux-command) [![Docker Image Size (latest by date)](https://img.shields.io/docker/image-size/wcjiang/linux-command)](https://hub.docker.com/r/wcjiang/linux-command) [![Docker Pulls](https://img.shields.io/docker/pulls/wcjiang/linux-command)](https://hub.docker.com/r/wcjiang/linux-command) + +轻松通过 docker 部署 linux-command 网站。 + +```bash +docker pull wcjiang/linux-command +``` + +```bash +docker run --name linux-command --rm -d -p 9665:80 wcjiang/linux-command:latest +# Or +docker run --name linux-command -itd -p 9665:80 wcjiang/linux-command:latest +``` + +在浏览器中访问以下 URL + +```bash +http://localhost:9665/ +``` + ## 目录 - [目录](#目录)