Skip to content

Commit 325bcd4

Browse files
committed
chore: Add docker support.
1 parent 0957786 commit 325bcd4

File tree

3 files changed

+54
-2
lines changed

3 files changed

+54
-2
lines changed

.github/workflows/ci.yml

Lines changed: 21 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -81,4 +81,24 @@ jobs:
8181
https://raw.githack.com/jaywcjlove/linux-command/${{ steps.changelog.outputs.gh-pages-short-hash }}/index.html
8282
8383
- run: npm install @jsdevtools/npm-publish -g
84-
- run: npm-publish --token="${{ secrets.NPM_TOKEN }}" ./package.json
84+
- run: npm-publish --token="${{ secrets.NPM_TOKEN }}" ./package.json
85+
86+
- run: rm -rf .deploy/linux-command.docset.zip
87+
88+
# Create Docker Image
89+
- name: Docker login
90+
if: steps.create_tag.outputs.successful
91+
run: docker login -u ${{ secrets.DOCKER_USER }} -p ${{ secrets.DOCKER_PASSWORD }}
92+
93+
- name: Build linux-command image
94+
if: steps.create_tag.outputs.successful
95+
run: docker image build -t linux-command .
96+
97+
- name: Tags & Push image
98+
if: steps.create_tag.outputs.successful
99+
run: |
100+
echo "outputs.tag - ${{ steps.changelog.outputs.version }}"
101+
docker tag linux-command ${{ secrets.DOCKER_USER }}/linux-command:${{steps.changelog.outputs.version}}
102+
docker tag linux-command ${{ secrets.DOCKER_USER }}/linux-command:latest
103+
docker push ${{ secrets.DOCKER_USER }}/linux-command:${{steps.changelog.outputs.version}}
104+
docker push ${{ secrets.DOCKER_USER }}/linux-command:latest

Dockerfile

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
FROM nginx:1-alpine
2+
3+
ENV APPDIR /usr/share/nginx/html
4+
RUN mkdir -p $APPDIR
5+
6+
RUN cat /etc/nginx/conf.d/default.conf
7+
8+
WORKDIR $APPDIR
9+
10+
ADD ./.deploy /usr/share/nginx/html

README.md

Lines changed: 23 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@
1414

1515
当前仓库搜集了 570 多个 Linux 命令,是一个非盈利性的仓库,生成了一个 web 网站方便使用,目前网站没有任何广告,内容包含 Linux 命令手册、详解、学习,内容来自网络和网友的补充,非常值得收藏的 Linux 命令速查手册。版权归属原作者,对任何法律问题及风险不承担任何责任,没有任何商业目的,如果认为侵犯了您的版权,请来信告知。我不能完全保证内容的正确性。通过使用本站内容带来的风险与我无关。当使用本站时,代表您已接受了本站的使用条款和隐私条款。
1616

17-
[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-插件) | [命令行工具](#命令行工具)
17+
[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)
1818

1919
### Web 版本
2020

@@ -115,6 +115,28 @@
115115
- [`@chenjiandongx/pls`](https://github.com/chenjiandongx/pls) Golang 版 [#129](https://github.com/jaywcjlove/linux-command/issues/129),由 [**@陈键冬**](https://github.com/chenjiandongx) 提供。
116116

117117

118+
## Docker
119+
120+
[![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)
121+
122+
轻松通过 docker 部署 linux-command 网站。
123+
124+
```bash
125+
docker pull wcjiang/linux-command
126+
```
127+
128+
```bash
129+
docker run --name linux-command --rm -d -p 9665:80 wcjiang/linux-command:latest
130+
# Or
131+
docker run --name linux-command -itd -p 9665:80 wcjiang/linux-command:latest
132+
```
133+
134+
在浏览器中访问以下 URL
135+
136+
```bash
137+
http://localhost:9665/
138+
```
139+
118140
## 目录
119141

120142
- [目录](#目录)

0 commit comments

Comments
 (0)