Skip to content

Commit eba19ec

Browse files
committed
Add initial files
1 parent a1293f0 commit eba19ec

File tree

8 files changed

+4184
-0
lines changed

8 files changed

+4184
-0
lines changed

Diff for: .github/workflows/build.yml

+63
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,63 @@
1+
name: Build Docker Image
2+
3+
on:
4+
push:
5+
branches:
6+
- main
7+
schedule:
8+
- cron: '0 0 * * *'
9+
workflow_dispatch:
10+
11+
env:
12+
DOCKER_HUB_USERNAME: 'marcusmu'
13+
IMAGE_NAME: 'php-codestyle-swissknife-docker'
14+
15+
permissions:
16+
contents: read
17+
packages: write
18+
19+
jobs:
20+
base:
21+
runs-on: ubuntu-latest
22+
steps:
23+
- name: Clone
24+
uses: actions/checkout@v4
25+
with:
26+
persist-credentials: false
27+
- name: Install apko
28+
uses: jaxxstorm/[email protected]
29+
with:
30+
repo: chainguard-dev/apko
31+
tag: v0.13.2
32+
binaries-location: apko_0.13.2_linux_amd64
33+
- name: Login into Github Docker Registry
34+
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
35+
- name: Login into Docker Hub
36+
run: echo "${{ secrets.DOCKER_HUB_PAT }}" | docker login -u ${{ env.DOCKER_HUB_USERNAME }} --password-stdin
37+
- name: Build base and push
38+
run: apko publish wolfi-base.yaml ghcr.io/${{ github.actor }}/${{ env.IMAGE_NAME }}:base
39+
main-build:
40+
needs: [ base ]
41+
runs-on: ubuntu-latest
42+
steps:
43+
- name: Login into Github Docker Registry
44+
run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
45+
- name: Login into Docker Hub
46+
run: echo "${{ secrets.DOCKER_HUB_PAT }}" | docker login -u ${{ env.DOCKER_HUB_USERNAME }} --password-stdin
47+
- name: Set up Docker Buildx
48+
uses: docker/setup-buildx-action@v3
49+
- name: Build and push
50+
uses: docker/build-push-action@v5
51+
with:
52+
push: true
53+
platforms: linux/amd64,linux/arm64
54+
tags: |
55+
${{ env.DOCKER_HUB_USERNAME }}/${{ env.IMAGE_NAME }}:latest
56+
ghcr.io/${{ github.actor }}/${{ env.IMAGE_NAME }}:latest
57+
- name: Attest
58+
uses: actions/attest-build-provenance@v1
59+
id: attest
60+
with:
61+
subject-name: ghcr.io/${{ github.actor }}/${{ env.IMAGE_NAME }}
62+
subject-digest: ${{ steps.push.outputs.digest }}
63+
push-to-registry: true

Diff for: .gitignore

+23
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
# Debug logs (npm, yarn)
2+
*.log
3+
4+
# Editor artifacts
5+
.*.sw[a-z]
6+
*~
7+
.#*
8+
.vscode
9+
.idea
10+
11+
# OS files
12+
# OS generated files
13+
.DS_Store
14+
.DS_Store?
15+
._*
16+
.Spotlight-V100
17+
.Trashes
18+
Icon?
19+
ehthumbs.db
20+
Thumbs.db
21+
22+
# composer
23+
/vendor

Diff for: Dockerfile

+44
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,44 @@
1+
FROM ghcr.io/m-arcus/php-codestyle-swissknife-docker:base
2+
3+
## uncomment this for local build
4+
#FROM cgr.dev/chainguard/wolfi-base:latest
5+
#RUN apk add --no-cache \
6+
# curl \
7+
# zip \
8+
# composer \
9+
# php-8.2 \
10+
# php-8.2-ctype \
11+
# php-8.2-curl \
12+
# php-8.2-dom \
13+
# php-8.2-fileinfo \
14+
# php-8.2-gd \
15+
# php-8.2-iconv \
16+
# php-8.2-intl \
17+
# php-8.2-mbstring \
18+
# php-8.2-mysqli \
19+
# php-8.2-mysqlnd \
20+
# php-8.2-openssl \
21+
# php-8.2-pdo \
22+
# php-8.2-pdo_mysql \
23+
# php-8.2-pdo_sqlite \
24+
# php-8.2-phar \
25+
# php-8.2-redis \
26+
# php-8.2-simplexml \
27+
# php-8.2-soap \
28+
# php-8.2-sodium \
29+
# php-8.2-xml \
30+
# php-8.2-zip
31+
32+
LABEL org.opencontainers.image.authors="M-arcus" \
33+
org.opencontainers.image.url="https://github.com/M-arcus/php-codestyle-swissknife-docker" \
34+
org.opencontainers.image.documentation="https://github.com/M-arcus/php-codestyle-swissknife-docker/blob/main/README.md" \
35+
org.opencontainers.image.source="https://github.com/M-arcus/php-codestyle-swissknife-docker" \
36+
org.opencontainers.image.vendor="M-arcus" \
37+
org.opencontainers.image.licenses="MIT" \
38+
org.opencontainers.image.title="PHP Code Style Swissknife Docker"
39+
40+
COPY php.ini /etc/php/conf.d/99-docker.ini
41+
42+
COPY composer.json composer.lock ./
43+
44+
RUN composer install --optimize-autoloader --no-interaction --no-progress --prefer-dist --no-dev

Diff for: README.md

+1
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
# PHP-Codestyle-Swissknife-Docker

Diff for: composer.json

+28
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,28 @@
1+
{
2+
"require": {
3+
"kubawerlos/php-cs-fixer-custom-fixers": "^3.21",
4+
"phpmd/phpmd": "^2.15",
5+
"phpstan/extension-installer": "^1.4",
6+
"phpstan/phpstan": "^1.11",
7+
"rector/rector": "^1.1",
8+
"symplify/easy-coding-standard": "^12.2",
9+
"symplify/phpstan-rules": "^11.4"
10+
},
11+
"require-dev": {
12+
"ergebnis/composer-normalize": "^2.42"
13+
},
14+
"minimum-stability": "stable",
15+
"prefer-stable": true,
16+
"config": {
17+
"allow-plugins": {
18+
"ergebnis/composer-normalize": true,
19+
"phpstan/extension-installer": true
20+
},
21+
"composer-normalize": {
22+
"indent-size": 4,
23+
"indent-style": "space"
24+
},
25+
"optimize-autoloader": true,
26+
"sort-packages": true
27+
}
28+
}

0 commit comments

Comments
 (0)