Skip to content

Commit

Permalink
Merge pull request #305 from beevelop/update
Browse files Browse the repository at this point in the history
Update image
  • Loading branch information
beevelop authored Feb 13, 2021
2 parents c6f6044 + 385be80 commit fede640
Show file tree
Hide file tree
Showing 5 changed files with 111 additions and 21 deletions.
67 changes: 67 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,67 @@
name: Docker Image

on:
schedule:
- cron: "0 10 * * *" # everyday at 10am
push:
branches: ["**"]
tags: ["v*.*.*"]

env:
platforms: linux/amd64,linux/arm64/v8,linux/arm/v7

jobs:
main:
runs-on: ubuntu-20.04
timeout-minutes: 10
steps:
- name: Check out the repo
uses: actions/checkout@v2
- name: Set imageName based on the repository name
id: step_one
run: |
imageName="${GITHUB_REPOSITORY/docker-/}"
echo $imageName
echo "imageName=$imageName" >> $GITHUB_ENV
- name: Docker meta
id: docker_meta
uses: crazy-max/ghaction-docker-meta@v1
with:
images: ${{ env.imageName }}
- name: Set up QEMU
uses: docker/setup-qemu-action@v1
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Login to Harbor
uses: docker/login-action@v1
with:
username: ${{ secrets.DOCKERHUB_USERNAME }}
password: ${{ secrets.DOCKERHUB_TOKEN }}
- name: Buildx cache
uses: actions/cache@v1
with:
path: ${{ github.workspace }}/cache
key: ${{ runner.os }}-docker-${{ hashfiles('cache/**') }}
restore-keys: |
${{ runner.os }}-docker
- name: Build and push
id: docker_build
uses: docker/build-push-action@v2
with:
platforms: ${{ env.platforms }}
push: ${{ github.event_name != 'pull_request' }}
tags: ${{ steps.docker_meta.outputs.tags }}
labels: ${{ steps.docker_meta.outputs.labels }}
cache-from: type=local,src=${{ github.workspace }}/cache
cache-to: type=local,dest=${{ github.workspace }}/cache
- name: Run Trivy vulnerability scanner
uses: aquasecurity/trivy-action@master
with:
image-ref: ${{ env.imageName }}:${{ steps.docker_meta.outputs.version }}
format: "template"
template: "@/contrib/sarif.tpl"
output: "trivy-results.sarif"
- name: Upload Trivy scan results to GitHub Security tab
uses: github/codeql-action/upload-sarif@v1
with:
sarif_file: "trivy-results.sarif"
8 changes: 0 additions & 8 deletions .travis.yml

This file was deleted.

22 changes: 13 additions & 9 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,11 +1,15 @@
FROM beevelop/base

ENV NODEJS_VERSION=10.16.3 \
PATH=$PATH:/opt/node/bin

WORKDIR "/opt/node"

RUN apt-get -qq update && apt-get -qq install -y curl ca-certificates --no-install-recommends && \
curl -sL https://nodejs.org/dist/v${NODEJS_VERSION}/node-v${NODEJS_VERSION}-linux-x64.tar.gz | tar xz --strip-components=1 && \
rm -rf /var/lib/apt/lists/* && \
apt-get clean
RUN apt-get update && apt-get install -y curl gnupg2 lsb-release && \
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - && \
apt-key fingerprint 1655A0AB68576280 && \
export VERSION=node_14.x && \
export DISTRO="$(lsb_release -s -c)" && \
echo "deb https://deb.nodesource.com/$VERSION $DISTRO main" | tee /etc/apt/sources.list.d/nodesource.list && \
echo "deb-src https://deb.nodesource.com/$VERSION $DISTRO main" | tee -a /etc/apt/sources.list.d/nodesource.list && \
apt-get update && apt-get install -y nodejs && \
node -v && npm -v && \
npm install -g yarn && \
yarn -v && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*
21 changes: 21 additions & 0 deletions LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
The MIT License (MIT)

Copyright (c) 2016-2021 Maik Hummel (beevelop)

Permission is hereby granted, free of charge, to any person obtaining a copy
of this software and associated documentation files (the "Software"), to deal
in the Software without restriction, including without limitation the rights
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
copies of the Software, and to permit persons to whom the Software is
furnished to do so, subject to the following conditions:

The above copyright notice and this permission notice shall be included in all
copies or substantial portions of the Software.

THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
SOFTWARE.
14 changes: 10 additions & 4 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,32 +1,38 @@
[![Travis](https://shields.beevelop.com/travis/beevelop/docker-nodejs.svg?style=flat-square)](https://travis-ci.org/beevelop/docker-nodejs)
[![Pulls](https://shields.beevelop.com/docker/pulls/beevelop/nodejs.svg?style=flat-square)](https://links.beevelop.com/d-nodejs)
[![Layers](https://shields.beevelop.com/docker/image/layers/beevelop/nodejs/latest.svg?style=flat-square)](https://links.beevelop.com/d-nodejs)
[![Size](https://shields.beevelop.com/docker/image/size/beevelop/nodejs/latest.svg?style=flat-square)](https://links.beevelop.com/d-nodejs)
[![Release](https://shields.beevelop.com/github/release/beevelop/docker-nodejs.svg?style=flat-square)](https://github.com/beevelop/docker-nodejs/releases)
![Badges](https://shields.beevelop.com/badge/badges-7-brightgreen.svg?style=flat-square)
[![Beevelop](https://links.beevelop.com/honey-badge)](https://beevelop.com)

# Node.js based on Ubuntu 16.04 (Xenial Xerus)
----
# Node.js 14 based on Ubuntu 20.04,

---

### Pull from Docker Hub

```
docker pull beevelop/nodejs:latest
```

### Build from GitHub

```
docker build -t beevelop/nodejs github.com/beevelop/docker-nodejs
```

### Run image

```
docker run -it beevelop/nodejs bash
```

### Use as base image

```Dockerfile
FROM beevelop/nodejs:latest
```

----
---

![One does not simply use latest](https://i.imgflip.com/1fgwxr.jpg)

0 comments on commit fede640

Please sign in to comment.