From cba5fb9076aa265cd8f19da25c9b0d49c3e689da Mon Sep 17 00:00:00 2001 From: jmeneghini Date: Fri, 19 Jan 2024 19:51:47 -0500 Subject: [PATCH] added docker-build to github action --- .github/workflows/docker-build.yml | 27 +++++++++++++++++++++++++++ Dockerfile | 7 +++++-- 2 files changed, 32 insertions(+), 2 deletions(-) create mode 100644 .github/workflows/docker-build.yml diff --git a/.github/workflows/docker-build.yml b/.github/workflows/docker-build.yml new file mode 100644 index 00000000..6b91faf1 --- /dev/null +++ b/.github/workflows/docker-build.yml @@ -0,0 +1,27 @@ +name: Docker Build + +on: + push: + branches: + - main + +jobs: + build-and-push: + runs-on: ubuntu-latest + steps: + - name: Check out the repo + uses: actions/checkout@v2 + + - name: Log in to Docker Hub + uses: docker/login-action@v1 + with: + username: ${{ secrets.DOCKER_HUB_USERNAME }} + password: ${{ secrets.DOCKER_HUB_ACCESS_TOKEN }} + + - name: Build and push Docker image + uses: docker/build-push-action@v2 + with: + context: . + file: ./Dockerfile + push: true + tags: jmeneghini/midsx_ubuntu:latest diff --git a/Dockerfile b/Dockerfile index 1f05a313..7056fe1d 100644 --- a/Dockerfile +++ b/Dockerfile @@ -16,12 +16,15 @@ RUN python3.10 -m pip install \ numpy \ nibabel -# Clone the MIDSX repository, and all submodules -RUN git clone --recurse-submodules https://github.com/jmeneghini/MIDSX.git /usr/src/MIDSX +# Make a directory for MIDSX +RUN mkdir /usr/src/MIDSX # Set the working directory WORKDIR /usr/src/MIDSX +# Copy the source code into the container +COPY . . + # Build and install MIDSX RUN mkdir build && cd build && cmake .. && make install