diff --git a/.github/workflows/DockerHub.yml b/.github/workflows/DockerHub.yml new file mode 100644 index 0000000..6a5f81a --- /dev/null +++ b/.github/workflows/DockerHub.yml @@ -0,0 +1,25 @@ +name: Build and Push Docker images to Docker Hub + +on: push +jobs: + build_job: + name: Build and push + runs-on: ubuntu-latest + + steps: + - name: Checkout repository + uses: actions/checkout@v4 + + - name: Set up Docker Buildx + uses: docker/setup-buildx-action@v3 + + - name: Login to Docker Hub + uses: docker/login-action@v3 + with: + username: ${{ secrets.DOCKERHUB_USERNAME }} + password: ${{ secrets.DOCKERHUB_TOKEN }} + + - name: Run Buildx and push image + run: | + docker buildx create --use --name multi-arch-builder --platform "linux/arm64,linux/amd64" + docker buildx build --platform "linux/arm64,linux/amd64" --tag ${{ secrets.DOCKERHUB_USERNAME }}/docker-hostmanager:0.0.4 --file Dockerfile --output type=image,push=true . diff --git a/Dockerfile b/Dockerfile index 85703b8..e4f718d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM iamluc/composer +FROM composer:1.4.3 ADD . /usr/local/src/docker-hostmanager diff --git a/composer.json b/composer.json index dfdba8d..42f7822 100644 --- a/composer.json +++ b/composer.json @@ -1,6 +1,7 @@ { "name": "iamluc/docker-hostmanager", "license": "MIT", + "version": "0.0.4", "type": "project", "description": "Update /etc/hosts to access running containers", "keywords": ["docker", "hosts"],