This is an automated email from the ASF dual-hosted git repository.

janardhan pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/systemds.git


The following commit(s) were added to refs/heads/main by this push:
     new de8a342  [SYSTEMDS-2941] Action for building docker images 
automatically
de8a342 is described below

commit de8a3426f955e354724e5af9370d21b763fc2993
Author: Janardhan Pulivarthi <j...@protonmail.com>
AuthorDate: Sat Jan 8 22:23:24 2022 +0530

    [SYSTEMDS-2941] Action for building docker images automatically
    
    This action uses [buildx](https://github.com/docker/buildx), which is
    a Docker CLI plugin with buildkit.
    
    Current change set focuses on the nightly build.
    
    Closes #1441.
---
 .github/workflows/docker-cd.yml | 53 +++++++++++++++++++++++++++++++++++++++++
 docker/sysds.Dockerfile         |  2 +-
 2 files changed, 54 insertions(+), 1 deletion(-)

diff --git a/.github/workflows/docker-cd.yml b/.github/workflows/docker-cd.yml
new file mode 100644
index 0000000..35a1fd3
--- /dev/null
+++ b/.github/workflows/docker-cd.yml
@@ -0,0 +1,53 @@
+name: Docker Image CI and CD
+
+on:
+  push:
+    branches: [ main ]
+  pull_request:
+    branches: [ main ]
+  workflow_dispatch:
+
+jobs:
+
+  build:
+    runs-on: ubuntu-latest
+
+    steps:
+    - name: Checkout
+      uses: actions/checkout@v2
+
+    # https://github.com/docker/setup-buildx-action
+    - name: Set up Docker Buildx
+      id: buildx
+      uses: docker/setup-buildx-action@v1
+      
+## Uncomment the following to inspect buildx build
+# 
+#     - name: Inspect builder
+#       run: |
+#           echo "Name:      ${{ steps.buildx.outputs.name }}"
+#           echo "Endpoint:  ${{ steps.buildx.outputs.endpoint }}"
+#           echo "Status:    ${{ steps.buildx.outputs.status }}"
+#           echo "Flags:     ${{ steps.buildx.outputs.flags }}"
+#           echo "Platforms: ${{ steps.buildx.outputs.platforms }}"
+
+    # IMPORTANT: The credentials should not be available via the
+    # Pull request, hence this if condition here.
+    # github.event_name != 'pull_request'
+    - name: Login to DockerHub
+#       if: github.event_name != 'pull_request'
+      uses: docker/login-action@v1
+      with:
+          username: ${{ secrets.DOCKERHUB_USER }}
+          password: ${{ secrets.DOCKERHUB_TOKEN }}
+
+    # https://github.com/docker/build-push-action
+    - name: Build and push
+      id: docker_build
+      uses: docker/build-push-action@v2
+      with:
+        context: .
+        file: ./docker/sysds.Dockerfile
+        push: true
+        tags: apache/systemds:nightly
+        
diff --git a/docker/sysds.Dockerfile b/docker/sysds.Dockerfile
index c1c71d3..c443d57 100644
--- a/docker/sysds.Dockerfile
+++ b/docker/sysds.Dockerfile
@@ -60,7 +60,6 @@ RUN apt-get update -qq \
        rm -r target/hadoop-test && \
        rm -r target/maven-archiver && \
        rm -r target/systemds-** && \
-       rm -r docker && \
        rm -r docs && \
        rm -r src && \
        rm -r /usr/lib/mvn && \
@@ -68,6 +67,7 @@ RUN apt-get update -qq \
        rm -r pom.xml && \ 
        rm -r ~/.m2
 
+
 COPY docker/mountFolder/main.dml /input/main.dml
 
 CMD ["systemds", "/input/main.dml"]

Reply via email to