Compare commits
36 Commits
Author | SHA1 | Date | |
---|---|---|---|
a042ef8de6 | |||
ac0b90a1c1 | |||
4a53f20dc3 | |||
20aaed1f1c | |||
6cfa6e80fb | |||
95ffcdd3c8 | |||
a56aca42f4 | |||
fe24d4fad9 | |||
30d98896e7 | |||
226d70846b | |||
2ecdef7675 | |||
452b356321 | |||
feca5c9d3c | |||
25fe1f48c7 | |||
b7d9a17121 | |||
e090cfad10 | |||
8dddaafee3 | |||
5d444fc763 | |||
f287eeec5d | |||
7765d1cada | |||
b4b4274811 | |||
c20d67b6a8 | |||
7fa62852c4 | |||
2e4fc781ce | |||
0db0e48ec3 | |||
bb64a8f4c6 | |||
1c603b1655 | |||
534a4dcfcf | |||
7d7aaee828 | |||
99ceab32b0 | |||
|
198702a335 | ||
|
a2182bf55b | ||
|
4077df5ce3 | ||
|
4380c47014 | ||
|
497f065a63 | ||
|
25873bee5b |
66
.github/workflows/docker-image.yml
vendored
66
.github/workflows/docker-image.yml
vendored
@ -1,10 +1,15 @@
|
||||
name: Build Docker Image
|
||||
name: Build Docker Image And Push
|
||||
|
||||
on:
|
||||
schedule:
|
||||
- cron: '0 1 * * 0'
|
||||
push:
|
||||
tags: [ 'v*.*.*' ]
|
||||
branches:
|
||||
- main
|
||||
pull_request:
|
||||
branches:
|
||||
- main
|
||||
# on:
|
||||
# push:
|
||||
# tags: [ 'v*.*.*' ]
|
||||
|
||||
env:
|
||||
PHP_EXTENSION_INSTALL_VERSION: 'latest'
|
||||
@ -12,32 +17,55 @@ env:
|
||||
|
||||
jobs:
|
||||
build:
|
||||
name: Build PHP ${{ matrix.php-version }}
|
||||
runs-on: ${{ matrix.os }}
|
||||
name: Build PHP 8.0
|
||||
runs-on: ubuntu-latest
|
||||
container: catthehacker/ubuntu:act-latest
|
||||
env:
|
||||
PHP_CLI_VERSION: ${{ matrix.php-version }}-cli-alpine
|
||||
strategy:
|
||||
matrix:
|
||||
os: [ ubuntu-latest ]
|
||||
php-version: [ '7.4', '8.0', '8.1', '8.2' ]
|
||||
max-parallel: 8
|
||||
PHP_CLI_VERSION: 8.0-cli-alpine
|
||||
steps:
|
||||
- name: Login to Docker Hub
|
||||
- name: Login to Git Docker Hub
|
||||
# https://github.com/docker/login-action#docker-hub
|
||||
uses: docker/login-action@v2
|
||||
uses: http://git.des8.com/docker/login-action@master
|
||||
with:
|
||||
username: ${{ secrets.DOCKER_USERNAME }}
|
||||
password: ${{ secrets.DOCKERHUB_ACCESSTOKEN }}
|
||||
registry: git.des8.com
|
||||
username: ${{ secrets.HUB_USERNAME }}
|
||||
password: ${{ secrets.HUB_PASSWORD }}
|
||||
|
||||
- name: Checkout
|
||||
uses: http://git.des8.com/docker/checkout@main
|
||||
with:
|
||||
username: ${{ secrets.HUB_USERNAME }}
|
||||
password: ${{ secrets.HUB_PASSWORD }}
|
||||
repository: heibai2006/webman-docker
|
||||
- run: echo "💡 The ${{ gitea.repository }} repository has been cloned to the runner."
|
||||
|
||||
- name: Set up Docker BuildX
|
||||
uses: https://git.des8.com/docker/setup-buildx-action@v2.6.0
|
||||
|
||||
- name: Extract metadata (tags, labels) for Docker
|
||||
id: meta
|
||||
uses: docker/metadata-action@9ec57ed1fcdbf14dcef7dfbe97b2010124a938b7
|
||||
with:
|
||||
images: ${{ secrets.HUB_USERNAME }}/webman-docker
|
||||
|
||||
- name: Build and push
|
||||
# https://github.com/docker/build-push-action
|
||||
uses: docker/build-push-action@v4
|
||||
uses: http://git.des8.com/docker/build-push-action@master
|
||||
env:
|
||||
# 必需有且置空,查看官方文档解释:https://docs.gitea.com/zh-cn/next/usage/actions/comparison?_highlight=build&_highlight=push&_highlight=action#dockerbuild-push-actionv4
|
||||
ACTIONS_RUNTIME_TOKEN: ''
|
||||
with:
|
||||
username: ${{ secrets.HUB_USERNAME }}
|
||||
password: ${{ secrets.HUB_PASSWORD }}
|
||||
repository: heibai2006/webman-docker
|
||||
context: .
|
||||
file: ./Dockerfile
|
||||
build-args: |
|
||||
PHP_CLI_VERSION=${{ env.PHP_CLI_VERSION }}
|
||||
PHP_EXTENSION_INSTALL_VERSION=${{ env.PHP_EXTENSION_INSTALL_VERSION }}
|
||||
COMPOSER_VERSION=${{ env.COMPOSER_VERSION }}
|
||||
push: true
|
||||
tags: |
|
||||
${{ secrets.DOCKER_USERNAME }}/docker-webman:${{ env.PHP_CLI_VERSION }}
|
||||
${{ secrets.DOCKER_USERNAME }}/docker-webman:${{ env.PHP_CLI_VERSION }}${{ github.ref_type == 'tag' && format('-{0}', github.ref_name) || '' }}
|
||||
${{ secrets.HUB_USERNAME }}/webman-docker:${{ env.PHP_CLI_VERSION }}
|
||||
${{ secrets.HUB_USERNAME }}/webman-docker:${{ env.PHP_CLI_VERSION }}${{ github.ref_type == 'tag' && format('-{0}', github.ref_name) || '' }}
|
||||
labels: ${{ steps.meta.outputs.labels }}
|
@ -1,5 +1,5 @@
|
||||
# https://hub.docker.com/_/php
|
||||
ARG PHP_CLI_VERSION=7.4-cli-alpine
|
||||
ARG PHP_CLI_VERSION=8.0-cli-alpine
|
||||
# https://hub.docker.com/r/mlocati/php-extension-installer
|
||||
ARG PHP_EXTENSION_INSTALL_VERSION=latest
|
||||
# https://hub.docker.com/r/composer/composer
|
||||
|
18
README.md
18
README.md
@ -6,14 +6,10 @@
|
||||
|
||||
### 镜像地址和 tag
|
||||
|
||||
[docker hub](https://hub.docker.com/r/krisss/docker-webman)
|
||||
[docker hub](https://hub.docker.com/r/heibai2006/webman-docker)
|
||||
|
||||
- krisss/docker-webman:7.4-cli-alpine
|
||||
- krisss/docker-webman:8.0-cli-alpine
|
||||
- krisss/docker-webman:8.1-cli-alpine
|
||||
- krisss/docker-webman:8.2-cli-alpine
|
||||
- https://git.des8.com/heibai2006/webman-docker:8.0-cli-alpine
|
||||
|
||||
> 此镜像会通过 github actions 动态更新 php 的小版本,镜像 tag 名不变
|
||||
|
||||
### 镜像中的组件
|
||||
|
||||
@ -25,7 +21,7 @@
|
||||
## 安装
|
||||
|
||||
```bash
|
||||
composer require webman-tech/docker
|
||||
composer require https://git.des8.com/heibai2006/webman-docker
|
||||
```
|
||||
|
||||
会在项目根目录下提供 `Dockerfile` 用于构建镜像,提供 `docker-compose.yml` 用于开发
|
||||
@ -43,7 +39,7 @@ docker run --rm --name webman \
|
||||
-it \
|
||||
--privileged -u root \
|
||||
--entrypoint /bin/sh \
|
||||
krisss/docker-webman:7.4-cli-alpine
|
||||
https://git.des8.com/heibai2006/webman-docker:8.0-cli-alpine
|
||||
```
|
||||
|
||||
创建项目
|
||||
@ -70,7 +66,7 @@ version: "3.7"
|
||||
|
||||
services:
|
||||
webman:
|
||||
image: krisss/docker-webman:${DOCKER_WEBMAN_VERSION:-7.4-cli-alpine}
|
||||
image: https://git.des8.com/heibai2006/webman-docker:${DOCKER_WEBMAN_VERSION:-7.4-cli-alpine}
|
||||
ports:
|
||||
- "${DOCKER_WEBMAN_PORT:-8787}:8787"
|
||||
volumes:
|
||||
@ -91,10 +87,10 @@ docker-compose up
|
||||
在项目下自建 `Dockerfile`,参考例子如下:
|
||||
|
||||
```Dockerfile
|
||||
ARG WEBMAN_DOCKER_VERSION=7.4-cli-alpine
|
||||
ARG WEBMAN_DOCKER_VERSION=8.0-cli-alpine
|
||||
|
||||
# https://github.com/krissss/docker-webman
|
||||
FROM krisss/docker-webman:$WEBMAN_DOCKER_VERSION
|
||||
FROM heibai2006/webman-docker:$WEBMAN_DOCKER_VERSION
|
||||
|
||||
# 增加额外的扩展
|
||||
#RUN install-php-extensions imagick
|
||||
|
@ -3,11 +3,13 @@
|
||||
"type": "library",
|
||||
"license": "MIT",
|
||||
"description": "docker for webman app",
|
||||
"require": {
|
||||
},
|
||||
"require": {},
|
||||
"autoload": {
|
||||
"psr-4": {
|
||||
"Kriss\\WebmanDocker\\": "src"
|
||||
}
|
||||
},
|
||||
"config": {
|
||||
"github-actions-date": "2024-01-01T00:52:30.495Z"
|
||||
}
|
||||
}
|
@ -2,7 +2,7 @@ version: "3.7"
|
||||
|
||||
services:
|
||||
webman:
|
||||
image: "krisss/docker-webman:${PHP_CLI_VERSION}"
|
||||
image: "http://git.des8.com/heibai2006/webman-docker:${PHP_CLI_VERSION}"
|
||||
build:
|
||||
context: "./"
|
||||
args:
|
||||
|
@ -1,8 +1,8 @@
|
||||
# 用于将项目构建成镜像
|
||||
ARG WEBMAN_DOCKER_VERSION=7.4-cli-alpine
|
||||
ARG WEBMAN_DOCKER_VERSION=8.0-cli-alpine
|
||||
|
||||
# https://github.com/krissss/docker-webman
|
||||
FROM krisss/docker-webman:$WEBMAN_DOCKER_VERSION
|
||||
FROM https://git.des8.com/heibai2006/webman-docker:$WEBMAN_DOCKER_VERSION
|
||||
|
||||
# 增加额外的扩展
|
||||
#RUN apk add --no-cache git
|
||||
|
@ -3,7 +3,7 @@ version: "3.7"
|
||||
|
||||
services:
|
||||
webman:
|
||||
image: krisss/docker-webman:${DOCKER_WEBMAN_VERSION:-7.4-cli-alpine}
|
||||
image: https://git.des8.com/heibai2006/webman-docker:${DOCKER_WEBMAN_VERSION:-8.0-cli-alpine}
|
||||
ports:
|
||||
- "${DOCKER_WEBMAN_PORT:-8787}:8787"
|
||||
volumes:
|
||||
|
Loading…
Reference in New Issue
Block a user