diff --git a/.github/workflows/docker.yml b/.github/workflows/docker.yml new file mode 100644 index 0000000..8aeec33 --- /dev/null +++ b/.github/workflows/docker.yml @@ -0,0 +1,20 @@ +name: Docker + +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 --no-cache . --file Dockerfile --tag mikenye/picard:testing diff --git a/.github/workflows/linting.yml b/.github/workflows/linting.yml new file mode 100644 index 0000000..104e314 --- /dev/null +++ b/.github/workflows/linting.yml @@ -0,0 +1,45 @@ +name: Linting + +on: + push: + branches: + - master + pull_request: + branches: + - master + +jobs: + + shellcheck: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Pull koalaman/shellcheck:stable Image + run: docker pull koalaman/shellcheck:stable + - name: Run Shellcheck against shell scripts + run: docker run --rm -i -v "$PWD:/mnt" koalaman/shellcheck:stable $(find . -type f -exec grep -m1 -l -E '^#!.*sh.*' {} \; | grep -v '/.git/') +# docker run --rm -i -v "$PWD:/mnt" koalaman/shellcheck:stable $(find . -type f -exec grep -m1 -l -E '^#!.*execline.*' {} \; | grep -v '/.git/') + + hadolint: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Pull hadolint/hadolint:latest Image + run: docker pull hadolint/hadolint:latest + - name: Run hadolint against Dockerfiles + run: docker run --rm -i -v "$PWD":/workdir --workdir /workdir --entrypoint hadolint hadolint/hadolint --ignore DL3008 --ignore SC2068 --ignore SC1091 --ignore DL3013 $(find . -type f -iname "Dockerfile*") + + markdownlint: + + runs-on: ubuntu-latest + + steps: + - uses: actions/checkout@v2 + - name: Pull markdownlint/markdownlint:latest Image + run: docker pull markdownlint/markdownlint:latest + - name: Run markdownlint against *.md files + run: docker run --rm -i -v "$(pwd)":/workdir --workdir /workdir markdownlint/markdownlint:latest --rules ~MD013,~MD033,~MD029 $(find . -type f -iname '*.md' | grep -v '/.git/') diff --git a/README.md b/README.md index d835aa4..ccf8eff 100644 --- a/README.md +++ b/README.md @@ -113,15 +113,19 @@ The following steps describe the method used to add, remove or update parameter(s) of an existing container. The generic idea is to destroy and re-create the container: - 1. Stop the container (if it is running): +1. Stop the container (if it is running): + ```shell docker stop picard ``` - 2. Remove the container: + +2. Remove the container: + ```shell docker rm picard ``` - 3. Create/start the container using the `docker run` command, by adjusting + +3. Create/start the container using the `docker run` command, by adjusting parameters as needed. **NOTE**: Since all application's data is saved under the `/config` container @@ -154,19 +158,25 @@ services: If the system on which the container runs doesn't provide a way to easily update the Docker image, the following steps can be followed: - 1. Fetch the latest image: +1. Fetch the latest image: + ```shell docker pull mikenye/picard ``` - 2. Stop the container: + +2. Stop the container: + ```shell docker stop picard ``` - 3. Remove the container: + +3. Remove the container: + ```shell docker rm picard ``` - 4. Start the container using the `docker run` command. + +4. Start the container using the `docker run` command. ## User/Group IDs @@ -202,7 +212,7 @@ Assuming that container's ports are mapped to the same host's ports, the graphical interface of the application can be accessed via: * A web browser: - + ```text http://:5800 ``` diff --git a/build_and_push.sh b/build_and_push.sh index 7846186..17397fc 100755 --- a/build_and_push.sh +++ b/build_and_push.sh @@ -5,15 +5,15 @@ REPO=mikenye IMAGE=picard # Build -docker image rm ${REPO}/${IMAGE}:builder +docker image rm "${REPO}/${IMAGE}:builder" docker image rm jlesage/baseimage-gui:ubuntu-18.04 -docker build --no-cache -f Dockerfile -t ${REPO}/${IMAGE}:builder . +docker build --no-cache -f Dockerfile -t "${REPO}/${IMAGE}:builder" . # Get version -VERSION=$(docker run --rm --entrypoint picard ${REPO}/${IMAGE}:builder -V | tail -1 | tr -s " " | cut -d " " -f 2 | tr -d ",") +VERSION=$(docker run --rm --entrypoint picard "${REPO}/${IMAGE}:builder" -V | tail -1 | tr -s " " | cut -d " " -f 2 | tr -d ",") -docker tag ${REPO}/${IMAGE}:builder ${REPO}/${IMAGE}:${VERSION} -docker tag ${REPO}/${IMAGE}:builder ${REPO}/${IMAGE}:latest +docker tag "${REPO}/${IMAGE}:builder" "${REPO}/${IMAGE}:${VERSION}" +docker tag "${REPO}/${IMAGE}:builder" "${REPO}/${IMAGE}:latest" -docker push ${REPO}/${IMAGE}:${VERSION} -docker push ${REPO}/${IMAGE}:latest +docker push "${REPO}/${IMAGE}:${VERSION}" +docker push "${REPO}/${IMAGE}:latest"