Skip to content

Commit fede640

Browse files
authored
Merge pull request #305 from beevelop/update
Update image
2 parents c6f6044 + 385be80 commit fede640

File tree

5 files changed

+111
-21
lines changed

5 files changed

+111
-21
lines changed

.github/workflows/docker.yml

Lines changed: 67 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,67 @@
1+
name: Docker Image
2+
3+
on:
4+
schedule:
5+
- cron: "0 10 * * *" # everyday at 10am
6+
push:
7+
branches: ["**"]
8+
tags: ["v*.*.*"]
9+
10+
env:
11+
platforms: linux/amd64,linux/arm64/v8,linux/arm/v7
12+
13+
jobs:
14+
main:
15+
runs-on: ubuntu-20.04
16+
timeout-minutes: 10
17+
steps:
18+
- name: Check out the repo
19+
uses: actions/checkout@v2
20+
- name: Set imageName based on the repository name
21+
id: step_one
22+
run: |
23+
imageName="${GITHUB_REPOSITORY/docker-/}"
24+
echo $imageName
25+
echo "imageName=$imageName" >> $GITHUB_ENV
26+
- name: Docker meta
27+
id: docker_meta
28+
uses: crazy-max/ghaction-docker-meta@v1
29+
with:
30+
images: ${{ env.imageName }}
31+
- name: Set up QEMU
32+
uses: docker/setup-qemu-action@v1
33+
- name: Set up Docker Buildx
34+
uses: docker/setup-buildx-action@v1
35+
- name: Login to Harbor
36+
uses: docker/login-action@v1
37+
with:
38+
username: ${{ secrets.DOCKERHUB_USERNAME }}
39+
password: ${{ secrets.DOCKERHUB_TOKEN }}
40+
- name: Buildx cache
41+
uses: actions/cache@v1
42+
with:
43+
path: ${{ github.workspace }}/cache
44+
key: ${{ runner.os }}-docker-${{ hashfiles('cache/**') }}
45+
restore-keys: |
46+
${{ runner.os }}-docker
47+
- name: Build and push
48+
id: docker_build
49+
uses: docker/build-push-action@v2
50+
with:
51+
platforms: ${{ env.platforms }}
52+
push: ${{ github.event_name != 'pull_request' }}
53+
tags: ${{ steps.docker_meta.outputs.tags }}
54+
labels: ${{ steps.docker_meta.outputs.labels }}
55+
cache-from: type=local,src=${{ github.workspace }}/cache
56+
cache-to: type=local,dest=${{ github.workspace }}/cache
57+
- name: Run Trivy vulnerability scanner
58+
uses: aquasecurity/trivy-action@master
59+
with:
60+
image-ref: ${{ env.imageName }}:${{ steps.docker_meta.outputs.version }}
61+
format: "template"
62+
template: "@/contrib/sarif.tpl"
63+
output: "trivy-results.sarif"
64+
- name: Upload Trivy scan results to GitHub Security tab
65+
uses: github/codeql-action/upload-sarif@v1
66+
with:
67+
sarif_file: "trivy-results.sarif"

.travis.yml

Lines changed: 0 additions & 8 deletions
This file was deleted.

Dockerfile

Lines changed: 13 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -1,11 +1,15 @@
11
FROM beevelop/base
22

3-
ENV NODEJS_VERSION=10.16.3 \
4-
PATH=$PATH:/opt/node/bin
5-
6-
WORKDIR "/opt/node"
7-
8-
RUN apt-get -qq update && apt-get -qq install -y curl ca-certificates --no-install-recommends && \
9-
curl -sL https://nodejs.org/dist/v${NODEJS_VERSION}/node-v${NODEJS_VERSION}-linux-x64.tar.gz | tar xz --strip-components=1 && \
10-
rm -rf /var/lib/apt/lists/* && \
11-
apt-get clean
3+
RUN apt-get update && apt-get install -y curl gnupg2 lsb-release && \
4+
curl -fsSL https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - && \
5+
apt-key fingerprint 1655A0AB68576280 && \
6+
export VERSION=node_14.x && \
7+
export DISTRO="$(lsb_release -s -c)" && \
8+
echo "deb https://deb.nodesource.com/$VERSION $DISTRO main" | tee /etc/apt/sources.list.d/nodesource.list && \
9+
echo "deb-src https://deb.nodesource.com/$VERSION $DISTRO main" | tee -a /etc/apt/sources.list.d/nodesource.list && \
10+
apt-get update && apt-get install -y nodejs && \
11+
node -v && npm -v && \
12+
npm install -g yarn && \
13+
yarn -v && \
14+
apt-get clean && \
15+
rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

LICENSE

Lines changed: 21 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,21 @@
1+
The MIT License (MIT)
2+
3+
Copyright (c) 2016-2021 Maik Hummel (beevelop)
4+
5+
Permission is hereby granted, free of charge, to any person obtaining a copy
6+
of this software and associated documentation files (the "Software"), to deal
7+
in the Software without restriction, including without limitation the rights
8+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9+
copies of the Software, and to permit persons to whom the Software is
10+
furnished to do so, subject to the following conditions:
11+
12+
The above copyright notice and this permission notice shall be included in all
13+
copies or substantial portions of the Software.
14+
15+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21+
SOFTWARE.

README.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1,32 +1,38 @@
1-
[![Travis](https://shields.beevelop.com/travis/beevelop/docker-nodejs.svg?style=flat-square)](https://travis-ci.org/beevelop/docker-nodejs)
21
[![Pulls](https://shields.beevelop.com/docker/pulls/beevelop/nodejs.svg?style=flat-square)](https://links.beevelop.com/d-nodejs)
32
[![Layers](https://shields.beevelop.com/docker/image/layers/beevelop/nodejs/latest.svg?style=flat-square)](https://links.beevelop.com/d-nodejs)
43
[![Size](https://shields.beevelop.com/docker/image/size/beevelop/nodejs/latest.svg?style=flat-square)](https://links.beevelop.com/d-nodejs)
54
[![Release](https://shields.beevelop.com/github/release/beevelop/docker-nodejs.svg?style=flat-square)](https://github.com/beevelop/docker-nodejs/releases)
65
![Badges](https://shields.beevelop.com/badge/badges-7-brightgreen.svg?style=flat-square)
76
[![Beevelop](https://links.beevelop.com/honey-badge)](https://beevelop.com)
87

9-
# Node.js based on Ubuntu 16.04 (Xenial Xerus)
10-
----
8+
# Node.js 14 based on Ubuntu 20.04,
9+
10+
---
11+
1112
### Pull from Docker Hub
13+
1214
```
1315
docker pull beevelop/nodejs:latest
1416
```
1517

1618
### Build from GitHub
19+
1720
```
1821
docker build -t beevelop/nodejs github.com/beevelop/docker-nodejs
1922
```
2023

2124
### Run image
25+
2226
```
2327
docker run -it beevelop/nodejs bash
2428
```
2529

2630
### Use as base image
31+
2732
```Dockerfile
2833
FROM beevelop/nodejs:latest
2934
```
3035

31-
----
36+
---
37+
3238
![One does not simply use latest](https://i.imgflip.com/1fgwxr.jpg)

0 commit comments

Comments
 (0)