From 4c6d1bdbd63c3511d33d06858708ce49ca155905 Mon Sep 17 00:00:00 2001 From: Aswin Murali Date: Wed, 13 Oct 2021 17:35:52 +0530 Subject: [PATCH] chore(docker): Added docker image support chore(docker): Implements Dockerfile for building images. chore(docker): Implements dockerignore file chore(docker): Implements docker image CI chore(docker): Enabling docker CI in docker-support branch to test build process chore(docker): Added docker image artifact upload support fix(docker): Added static docker image label for uploading chore(docker): Changed base image to `python:3.8-alpine` chore(docker): Added license header chore(docker): Removed `docker-support` branch chore(docker): Updated authors --- .dockerignore | 5 ++++ .github/workflows/docker-image.yml | 23 ++++++++++++++++++ Dockerfile | 38 ++++++++++++++++++++++++++++++ 3 files changed, 66 insertions(+) create mode 100644 .dockerignore create mode 100644 .github/workflows/docker-image.yml create mode 100644 Dockerfile diff --git a/.dockerignore b/.dockerignore new file mode 100644 index 0000000..55eb810 --- /dev/null +++ b/.dockerignore @@ -0,0 +1,5 @@ +.git +.gitignore +Dockerfile* +docker-compose* +.vscode \ No newline at end of file diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml new file mode 100644 index 0000000..a596dc0 --- /dev/null +++ b/.github/workflows/docker-image.yml @@ -0,0 +1,23 @@ +name: Docker Image CI + +on: + push: + branches: [ master ] + pull_request: + branches: [ master ] + +jobs: + + build: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Build the Docker image + run: docker build . --file Dockerfile --tag nirjas:latest + + - name: Upload image + uses: ishworkh/docker-image-artifact-upload@v1 + with: + image: "nirjas:latest" diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..77b3ccd --- /dev/null +++ b/Dockerfile @@ -0,0 +1,38 @@ +# Copyright (C) 2020 Ayush Bhardwaj (classicayush@gmail.com), +# Kaushlendra Pratap (kaushlendrapratap.9837@gmail.com) +# Aswin Murali (aswinmurali.co@gmail.com) +# +# SPDX-License-Identifier: LGPL-2.1 +# +# This library is free software; you can redistribute it and/or +# modify it under the terms of the GNU Lesser General Public +# License as published by the Free Software Foundation; either +# version 2.1 of the License, or (at your option) any later version. +# +# This library is distributed in the hope that it will be useful, +# but WITHOUT ANY WARRANTY; without even the implied warranty of +# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU +# Lesser General Public License for more details. +# +# You should have received a copy of the GNU Lesser General Public +# License along with this library; if not, write to the Free Software +# Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA +# +# Docker image for nirjas +# +# Build +# docker build -t nirjas . +# +# Run +# docker run --rm -it nirjas +# docker run --rm -it nirjas nirjas + +FROM python:3.8-alpine + +COPY . ./ + +RUN python3 setup.py install + +# Default command as intro text + +CMD [ "nirjas" , "-h" ]