diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..68a6a34 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,5 @@ +Dockerfile +build.sh +README.md +LICENSE +.github \ No newline at end of file diff --git a/.github/workflows/main.yml b/.github/workflows/main.yml new file mode 100644 index 0000000..530f9cc --- /dev/null +++ b/.github/workflows/main.yml @@ -0,0 +1,63 @@ +name: CI Main + +on: + push: + branches: + - main + tags: + - '*' + workflow_dispatch: +jobs: + buildx: + runs-on: ubuntu-latest + steps: + - + name: Checkout + uses: actions/checkout@v4.1.6 + with: + # [Required] Access token with `workflow` scope. + token: ${{ secrets.WORKFLOW_SECRET }} + - + name: Run GitHub Actions Version Updater + uses: saadmk11/github-actions-version-updater@v0.8.1 + with: + # [Required] Access token with `workflow` scope. + token: ${{ secrets.WORKFLOW_SECRET }} + - + # Add support for more platforms with QEMU (optional) + # https://github.com/docker/setup-qemu-action + name: Set up QEMU + uses: docker/setup-qemu-action@v3 + - + name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3.3.0 + - + name: Login to DockerHub + uses: docker/login-action@v3.2.0 + with: + username: ${{ secrets.DOCKER_HUB_USERNAME }} + password: ${{ secrets.DOCKER_HUB_PASSWORD }} + - + name: Login to GitHub Container Registry + uses: docker/login-action@v3.2.0 + with: + registry: ghcr.io + username: ${{ github.repository_owner }} + password: ${{ secrets.GITHUB_TOKEN }} + - + name: Build and push + uses: docker/build-push-action@v5.3.0 + with: + context: . + platforms: linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/ppc64le,linux/riscv64,linux/s390x + push: true + tags: | + snowdreamtech/alpine:latest + snowdreamtech/alpine:3.20.0 + snowdreamtech/alpine:3.20 + snowdreamtech/alpine:3 + ghcr.io/snowdreamtech/alpine:latest + ghcr.io/snowdreamtech/alpine:3.20.0 + ghcr.io/snowdreamtech/alpine:3.20 + ghcr.io/snowdreamtech/alpine:3 + \ No newline at end of file diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..371f0b3 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,5 @@ +FROM alpine:3.20.0 + +LABEL maintainer="snowdream " + +RUN apk add --no-cache tzdata diff --git a/LICENSE b/LICENSE new file mode 100644 index 0000000..0d663f6 --- /dev/null +++ b/LICENSE @@ -0,0 +1,22 @@ +(The MIT License) + +Copyright (c) 2024-present SnowdreamTech Inc. + +Permission is hereby granted, free of charge, to any person obtaining +a copy of this software and associated documentation files (the +'Software'), to deal in the Software without restriction, including +without limitation the rights to use, copy, modify, merge, publish, +distribute, sublicense, and/or sell copies of the Software, and to +permit persons to whom the Software is furnished to do so, subject to +the following conditions: + +The above copyright notice and this permission notice shall be +included in all copies or substantial portions of the Software. + +THE SOFTWARE IS PROVIDED 'AS IS', WITHOUT WARRANTY OF ANY KIND, +EXPRESS OR IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF +MERCHANTABILITY, FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. +IN NO EVENT SHALL THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY +CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, +TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE +SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. \ No newline at end of file diff --git a/README.md b/README.md new file mode 100644 index 0000000..77788b9 --- /dev/null +++ b/README.md @@ -0,0 +1,43 @@ +# Alpine + +[![Alpine](http://dockeri.co/image/snowdreamtech/alpine)](https://hub.docker.com/r/snowdreamtech/alpine) + +Docker Image packaging for Alpine. (amd64, arm32v6, arm32v7, arm64v8, i386, ppc64le,riscv64, s390x) + +# Run + +```bash +docker run --rm snowdreamtech/alpine:latest +``` + +```bash +docker run -e TZ=Asia/Shanghai --rm snowdreamtech/alpine:latest +``` + +# Development + +```bash +docker buildx create --use --name build --node build --driver-opt network=host +docker buildx build -t snowdreamtech/alpine --platform=linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/ppc64le,linux/riscv64,linux/s390x . --push +``` + +## Reference + +1. [使用 buildx 构建多平台 Docker 镜像](https://icloudnative.io/posts/multiarch-docker-with-buildx/) +1. [使用 buildx 构建多平台 Docker 镜像](https://blog.bwcxtech.com/posts/43dd6afb/) +1. [如何使用 docker buildx 构建跨平台 Go 镜像](https://waynerv.com/posts/building-multi-architecture-images-with-docker-buildx/#buildx-%E7%9A%84%E8%B7%A8%E5%B9%B3%E5%8F%B0%E6%9E%84%E5%BB%BA%E7%AD%96%E7%95%A5) +1. [Building Multi-Arch Images for Arm and x86 with Docker Desktop](https://www.docker.com/blog/multi-arch-images/) +1. [How to Rapidly Build Multi-Architecture Images with Buildx](https://www.docker.com/blog/how-to-rapidly-build-multi-architecture-images-with-buildx/) +1. [Faster Multi-Platform Builds: Dockerfile Cross-Compilation Guide](https://www.docker.com/blog/faster-multi-platform-builds-dockerfile-cross-compilation-guide/) +1. [docker/buildx](https://github.com/docker/buildx) + +## Contact (备注:alpine) + +* Email: sn0wdr1am@qq.com +* QQ: 3217680847 +* QQ群: 949022145 +* WeChat/微信群: sn0wdr1am + +## License + +MIT diff --git a/build.sh b/build.sh new file mode 100644 index 0000000..3b085ff --- /dev/null +++ b/build.sh @@ -0,0 +1,17 @@ +#!/bin/sh + +DOCKER_HUB_PROJECT=snowdreamtech/alpine + +GITHUB_PROJECT=ghcr.io/snowdreamtech/alpine + +docker buildx build --platform=linux/386,linux/amd64,linux/arm/v6,linux/arm/v7,linux/arm64,linux/ppc64le,linux/riscv64,linux/s390x \ +-t ${DOCKER_HUB_PROJECT}:latest \ +-t ${DOCKER_HUB_PROJECT}:3.20.0 \ +-t ${DOCKER_HUB_PROJECT}:3.20 \ +-t ${DOCKER_HUB_PROJECT}:3 \ +-t ${GITHUB_PROJECT}:latest \ +-t ${GITHUB_PROJECT}:3.20.0 \ +-t ${GITHUB_PROJECT}:3.20 \ +-t ${GITHUB_PROJECT}:3 \ +. \ +--push