diff --git a/.dockerignore b/.dockerignore index 8ff7a6ad..50d4dff2 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,12 +1,16 @@ -/target -.git -.gitignore -.github -*.md -Dockerfile -.dockerignore -LICENSE-APACHE -LICENSE-MIT -*.sh -.editorconfig -.gitattributes +# Ignore everything +* + +# Explicitly allow files +!src/**/*.rs +!build.rs +!Cargo.toml +!Cargo.lock +!Dockerfile +!services.txt +!resources/countries_flags/**/*.svg +!resources/DB/*.mmdb +!resources/fonts/subset/*.ttf +!resources/logos/raw/icon.png +!resources/packaging/windows/graphics/sniffnet.ico +!resources/sounds/*.mp3 diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml index c41d70b5..a4db437b 100644 --- a/.github/workflows/docker.yml +++ b/.github/workflows/docker.yml @@ -8,36 +8,36 @@ jobs: name: Docker Build runs-on: ubuntu-latest steps: - - name: Checkout - uses: actions/checkout@v4 + - name: Checkout + uses: actions/checkout@v4 - - name: Extract version from Cargo.toml - id: cargo-version - run: | - VERSION=$(grep -m1 "^version" Cargo.toml | cut -d'"' -f2) - echo "VERSION=$VERSION" >> $GITHUB_ENV - echo "version=$VERSION" >> $GITHUB_OUTPUT + - name: Extract version from Cargo.toml + id: cargo-version + run: | + VERSION=v$(grep -m1 "^version" Cargo.toml | cut -d'"' -f2) + echo "VERSION=$VERSION" >> $GITHUB_ENV + echo "version=$VERSION" >> $GITHUB_OUTPUT - - name: Set up QEMU - uses: docker/setup-qemu-action@v3 + - name: Set up QEMU + uses: docker/setup-qemu-action@v3 - - name: Set up Docker Buildx - uses: docker/setup-buildx-action@v3 + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 - - name: Login to GitHub Container Registry - uses: docker/login-action@v3 - with: - registry: ghcr.io - username: ${{ github.actor }} - password: ${{ secrets.GITHUB_TOKEN }} + - name: Login to GitHub Container Registry + uses: docker/login-action@v3 + with: + registry: ghcr.io + username: ${{ github.actor }} + password: ${{ secrets.GHCR_TOKEN }} - - name: Build and push - uses: docker/build-push-action@v5 - with: - context: . - platforms: linux/amd64,linux/arm64,linux/386,linux/arm/v7 - push: true - tags: | - ghcr.io/${{ github.repository }}:latest - ghcr.io/${{ github.repository }}:${{ env.VERSION }} - ghcr.io/${{ github.repository }}:${{ github.sha }} + - name: Build and push + uses: docker/build-push-action@v5 + with: + context: . + platforms: linux/amd64,linux/arm64,linux/386,linux/arm/v7 + push: true + tags: | + ghcr.io/${{ github.repository }}:latest + ghcr.io/${{ github.repository }}:${{ env.VERSION }} + ghcr.io/${{ github.repository }}:${{ github.sha }}