Compare commits

..

No commits in common. "main" and "v2.3.0" have entirely different histories.
main ... v2.3.0

7 changed files with 37 additions and 63 deletions

View File

@ -1,15 +1,10 @@
name: Build Docker Image And Push
name: Build Docker Image
on:
schedule:
- cron: '0 1 * * 0'
push:
branches:
- main
pull_request:
branches:
- main
# on:
# push:
# tags: [ 'v*.*.*' ]
tags: [ 'v*.*.*' ]
env:
PHP_EXTENSION_INSTALL_VERSION: 'latest'
@ -17,55 +12,32 @@ env:
jobs:
build:
name: Build PHP 8.0
runs-on: ubuntu-latest
container: catthehacker/ubuntu:act-latest
name: Build PHP ${{ matrix.php-version }}
runs-on: ${{ matrix.os }}
env:
PHP_CLI_VERSION: 8.0-cli-alpine
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
steps:
- name: Login to Git Docker Hub
- name: Login to Docker Hub
# https://github.com/docker/login-action#docker-hub
uses: http://git.des8.com/docker/login-action@master
uses: docker/login-action@v2
with:
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
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKERHUB_ACCESSTOKEN }}
- 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: 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: ''
uses: docker/build-push-action@v4
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.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 }}
${{ 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) || '' }}

View File

@ -1,5 +1,5 @@
# https://hub.docker.com/_/php
ARG PHP_CLI_VERSION=8.0-cli-alpine
ARG PHP_CLI_VERSION=7.4-cli-alpine
# https://hub.docker.com/r/mlocati/php-extension-installer
ARG PHP_EXTENSION_INSTALL_VERSION=latest
# https://hub.docker.com/r/composer/composer

View File

@ -6,10 +6,14 @@
### 镜像地址和 tag
[docker hub](https://hub.docker.com/r/heibai2006/webman-docker)
[docker hub](https://hub.docker.com/r/krisss/docker-webman)
- https://git.des8.com/heibai2006/webman-docker:8.0-cli-alpine
- 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
> 此镜像会通过 github actions 动态更新 php 的小版本,镜像 tag 名不变
### 镜像中的组件
@ -21,7 +25,7 @@
## 安装
```bash
composer require https://git.des8.com/heibai2006/webman-docker
composer require webman-tech/docker
```
会在项目根目录下提供 `Dockerfile` 用于构建镜像,提供 `docker-compose.yml` 用于开发
@ -39,7 +43,7 @@ docker run --rm --name webman \
-it \
--privileged -u root \
--entrypoint /bin/sh \
https://git.des8.com/heibai2006/webman-docker:8.0-cli-alpine
krisss/docker-webman:7.4-cli-alpine
```
创建项目
@ -66,7 +70,7 @@ version: "3.7"
services:
webman:
image: https://git.des8.com/heibai2006/webman-docker:${DOCKER_WEBMAN_VERSION:-7.4-cli-alpine}
image: krisss/docker-webman:${DOCKER_WEBMAN_VERSION:-7.4-cli-alpine}
ports:
- "${DOCKER_WEBMAN_PORT:-8787}:8787"
volumes:
@ -87,10 +91,10 @@ docker-compose up
在项目下自建 `Dockerfile`,参考例子如下:
```Dockerfile
ARG WEBMAN_DOCKER_VERSION=8.0-cli-alpine
ARG WEBMAN_DOCKER_VERSION=7.4-cli-alpine
# https://github.com/krissss/docker-webman
FROM heibai2006/webman-docker:$WEBMAN_DOCKER_VERSION
FROM krisss/docker-webman:$WEBMAN_DOCKER_VERSION
# 增加额外的扩展
#RUN install-php-extensions imagick

View File

@ -3,13 +3,11 @@
"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"
}
}

View File

@ -2,7 +2,7 @@ version: "3.7"
services:
webman:
image: "http://git.des8.com/heibai2006/webman-docker:${PHP_CLI_VERSION}"
image: "krisss/docker-webman:${PHP_CLI_VERSION}"
build:
context: "./"
args:

View File

@ -1,8 +1,8 @@
# 用于将项目构建成镜像
ARG WEBMAN_DOCKER_VERSION=8.0-cli-alpine
ARG WEBMAN_DOCKER_VERSION=7.4-cli-alpine
# https://github.com/krissss/docker-webman
FROM https://git.des8.com/heibai2006/webman-docker:$WEBMAN_DOCKER_VERSION
FROM krisss/docker-webman:$WEBMAN_DOCKER_VERSION
# 增加额外的扩展
#RUN apk add --no-cache git

View File

@ -3,7 +3,7 @@ version: "3.7"
services:
webman:
image: https://git.des8.com/heibai2006/webman-docker:${DOCKER_WEBMAN_VERSION:-8.0-cli-alpine}
image: krisss/docker-webman:${DOCKER_WEBMAN_VERSION:-7.4-cli-alpine}
ports:
- "${DOCKER_WEBMAN_PORT:-8787}:8787"
volumes: