You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@nuttx.apache.org by GitBox <gi...@apache.org> on 2022/02/24 23:30:57 UTC

[GitHub] [incubator-nuttx] btashton commented on a change in pull request #5611: docker_linux.yml: Use docker actions to build docker image.

btashton commented on a change in pull request #5611:
URL: https://github.com/apache/incubator-nuttx/pull/5611#discussion_r814357067



##########
File path: .github/workflows/docker_linux.yml
##########
@@ -39,25 +39,33 @@ jobs:
   push:
     runs-on: ubuntu-latest
     env:
-      DOCKER_BUILDKIT: 1

Review comment:
       If you are going to use these actions consider also using this which let's us get parallel builds for the different build containers. 
   https://github.com/docker/setup-buildx-action

##########
File path: .github/workflows/docker_linux.yml
##########
@@ -39,25 +39,33 @@ jobs:
   push:
     runs-on: ubuntu-latest
     env:
-      DOCKER_BUILDKIT: 1
       IMAGE_TAG: ghcr.io/${{ github.repository }}/apache-nuttx-ci-linux
     steps:
-      - uses: actions/checkout@v2
+      - name: Checkout repository
+        uses: actions/checkout@v2
 
       - name: Log into registry
-        run: echo "${{ secrets.GITHUB_TOKEN }}" | docker login ghcr.io -u ${{ github.actor }} --password-stdin
+        uses: docker/login-action@v1
+        with:
+          registry: ghcr.io
+          username: ${{ github.actor }}
+          password: ${{ secrets.GITHUB_TOKEN }}
 
-      - name: Build Linux image
-        run: |
-          echo "Building Linux Image using cache from $IMAGE_TAG"
-
-          docker build \
-            --build-arg BUILDKIT_INLINE_CACHE=1 \
-            --cache-from $IMAGE_TAG \
-            --tag $IMAGE_TAG \
-            -f ./tools/ci/docker/linux/Dockerfile ./tools/ci/docker/
-        
-      - name: Push Linux image
-        if: (github.event_name == 'push') && (github.ref == 'refs/heads/master')
+      - name: Build and load
+        uses: docker/build-push-action@v2
+        with:
+          context: tools/ci/docker/linux
+          load: true
+          tags: ${{ env.IMAGE_TAG }}
+
+      - name: Test Image
         run: |
-          docker push $IMAGE_TAG
+          docker run --rm ${{ env.IMAGE_TAG }}

Review comment:
       Not needed. There is no entry point worth testing on this image. 




-- 
This is an automated message from the Apache Git Service.
To respond to the message, please log on to GitHub and use the
URL above to go to the specific comment.

To unsubscribe, e-mail: commits-unsubscribe@nuttx.apache.org

For queries about this service, please contact Infrastructure at:
users@infra.apache.org