diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 4073074..b9fe5ec 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -1,8 +1,6 @@ -name: Build Docker Image +name: Build Docker Image And Push on: - schedule: - - cron: '0 1 * * 0' push: tags: [ 'v*.*.*' ] @@ -19,15 +17,16 @@ jobs: strategy: matrix: os: [ ubuntu-latest ] - php-version: [ '7.4', '8.0', '8.1', '8.2' ] + php-version: ['8.0'] max-parallel: 8 steps: - - name: Login to Docker Hub + - name: Login to Git Hub # https://github.com/docker/login-action#docker-hub - uses: docker/login-action@v2 + uses: https://git.des8.com/docker/login-action@v3 with: - username: ${{ secrets.DOCKER_USERNAME }} - password: ${{ secrets.DOCKERHUB_ACCESSTOKEN }} + registry: git.des8.com + username: ${{ secrets.HUB_USERNAME }} + password: ${{ secrets.HUB_PASSWORD }} - name: Build and push # https://github.com/docker/build-push-action @@ -39,5 +38,5 @@ jobs: 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) || '' }} diff --git a/.github/workflows/keep-actions-running.yml b/.github/workflows/keep-actions-running.yml deleted file mode 100644 index 3edce88..0000000 --- a/.github/workflows/keep-actions-running.yml +++ /dev/null @@ -1,35 +0,0 @@ -name: Keep Actions Running - -on: - schedule: - - cron: '0 0 1 * *' - workflow_dispatch: - -jobs: - update: - runs-on: ubuntu-latest - - steps: - - name: Checkout code - uses: actions/checkout@v3 - with: - ref: main - - - name: Get current time - uses: josStorer/get-current-time@v2 - with: - format: "YYYY/MM/DD HH:mm:ss.SSS" - id: current-time - - - name: Update Json File - uses: restackio/update-json-file-action@v2.0 - with: - file: composer.json - fields: "{\"config.github-actions-date\": \"${{ steps.current-time.outputs.time }}\"}" - - - name: Commit updated CHANGELOG - uses: stefanzweifel/git-auto-commit-action@v5 - with: - branch: main - commit_message: keep actions running - file_pattern: composer.json diff --git a/Dockerfile b/Dockerfile index 7d55c62..3ec1837 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ # https://hub.docker.com/_/php -ARG PHP_CLI_VERSION=7.4-cli-alpine +ARG PHP_CLI_VERSION=8.1-cli-alpine # https://hub.docker.com/r/mlocati/php-extension-installer ARG PHP_EXTENSION_INSTALL_VERSION=latest # https://hub.docker.com/r/composer/composer diff --git a/README.md b/README.md index b5cc995..edd532d 100644 --- a/README.md +++ b/README.md @@ -6,16 +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 名不变 - -> 2.3.0 之后增加类似 `7.4-cli-alpine-v2.3.0` 形式的镜像版本,用于固定一个在发布版本时当前镜像中的各个组件版本(求稳可以用这种版本的镜像) ### 镜像中的组件 @@ -27,7 +21,7 @@ ## 安装 ```bash -composer require webman-tech/docker +composer require https://git.des8.com/heibai2006/webman-docker ``` 会在项目根目录下提供 `Dockerfile` 用于构建镜像,提供 `docker-compose.yml` 用于开发 @@ -45,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 ``` 创建项目 @@ -72,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: @@ -93,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 diff --git a/src/copy/Dockerfile b/src/copy/Dockerfile index 4dd278e..a4cebba 100644 --- a/src/copy/Dockerfile +++ b/src/copy/Dockerfile @@ -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 diff --git a/src/copy/docker-compose.yml b/src/copy/docker-compose.yml index 1e3cbe4..c32299d 100644 --- a/src/copy/docker-compose.yml +++ b/src/copy/docker-compose.yml @@ -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: