Skip to content
This repository was archived by the owner on Mar 12, 2021. It is now read-only.

Bump the version of nodejs and of ajv-cli to fix security vuls report… #2

Open
wants to merge 11 commits into
base: master
Choose a base branch
from
Open
38 changes: 38 additions & 0 deletions .github/workflows/docker-build.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,38 @@
name: Docker Build and Test

on:
push:
tags:
- '*'

jobs:
build:
runs-on: ubuntu-latest

steps:
- name: Checkout repository
uses: actions/checkout@v2

- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1

- name: Cache Docker layers
uses: actions/cache@v2
with:
path: /tmp/.buildx-cache
key: ${{ runner.os }}-buildx-${{ github.sha }}
restore-keys: |
${{ runner.os }}-buildx-

# add docker hub secrets
- name: Log in to Docker Hub
uses: docker/login-action@v2
with:
username: "mohamedelhabib"
password: ${{ secrets.DOCKER_TOKEN }}

- name: Build Docker image
# build the image with the Dockerfile in the current directory and tag it with the git tag
run: docker build . --file Dockerfile --tag mohamedelhabib/docker-ajv:$GITHUB_REF_NAME
- name: Push Docker image
run: docker push mohamedelhabib/docker-ajv:$GITHUB_REF_NAME
9 changes: 5 additions & 4 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,8 +1,9 @@
FROM node:8-alpine

ARG AJV_CLI_VERSION=3.2.1
RUN npm install -g ajv-cli@${AJV_CLI_VERSION}
FROM node:22.9.0-alpine3.20

ARG AJV_CLI_VERSION=5.0.0
ARG AJV_FORMATS_VERSION=3.0.1
RUN npm install -g ajv-cli@${AJV_CLI_VERSION} \
&& npm install -g ajv-formats@${AJV_FORMATS_VERSION}
VOLUME ["/data"]
WORKDIR "/data"

Expand Down