Skip to content

Commit

Permalink
ci(lint): use super-linter
Browse files Browse the repository at this point in the history
Replace all other linters with super-linter
  • Loading branch information
ttshivers committed Nov 14, 2020
1 parent 554638e commit 2e23cbd
Show file tree
Hide file tree
Showing 13 changed files with 266 additions and 189 deletions.
3 changes: 3 additions & 0 deletions .editorconfig
Original file line number Diff line number Diff line change
Expand Up @@ -7,3 +7,6 @@ indent_size = 2
indent_style = space
insert_final_newline = true
trim_trailing_whitespace = true

[*.sh]
space_redirects = true # like -sr
18 changes: 18 additions & 0 deletions .github/super-linter-problem-matcher.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@

{
"problemMatcher": [
{
"owner": "markdownlint",
"pattern": [
{
"regexp": "^([^:]*):(\\d+):?(\\d+)?\\s([\\w-\\/]*)\\s(.*)$",
"file": 1,
"line": 2,
"column": 3,
"code": 4,
"message": 5
}
]
}
]
}
14 changes: 0 additions & 14 deletions .github/workflows/eclint.yml

This file was deleted.

24 changes: 24 additions & 0 deletions .github/workflows/linter.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
name: Lint
on:
pull_request:

jobs:
super-linter:
name: Lint
runs-on: ubuntu-latest

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

- name: Setup Node
uses: actions/setup-node@v1

- name: Add matchers
run: |
echo "::add-matcher::.github/super-linter-problem-matcher.json"
- name: Lint Code Base
uses: github/super-linter@v3
env:
GITHUB_TOKEN: ${{ secrets.GITHUB_TOKEN }}
FILTER_REGEX_EXCLUDE: .*.template
19 changes: 0 additions & 19 deletions .github/workflows/markdown-link-check.yml

This file was deleted.

20 changes: 0 additions & 20 deletions .github/workflows/shfmt.yml

This file was deleted.

43 changes: 31 additions & 12 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
@@ -1,26 +1,45 @@
# Contributing to docker-node

Thank you for your contribution. Here are a set of guidelines for contributing to the docker-node project.
Thank you for your contribution. Here are a set of guidelines for contributing
to the docker-node project.

## Version Updates

New **Node.js** releases are released as soon as possible.

New **NPM** releases are not tracked. We simply use the NPM version bundled in the corresponding Node.js release.
New **NPM** releases are not tracked. We simply use the NPM version bundled in
the corresponding Node.js release.

**Yarn** is updated to the latest version only when there is a new Node.js SemVer PATCH release (unless Yarn has received a security update), and it's updated only in the branch with the new release, preferably in the same PR. The `update.sh` script does this automatically when invoked with a specific branch, e.g. `./update.sh 6.10`.
**Yarn** is updated to the latest version only when there is a new Node.js
SemVer PATCH release (unless Yarn has received a security update), and it's
updated only in the branch with the new release, preferably in the same PR. The
`update.sh` script does this automatically when invoked with a specific branch,
e.g. `./update.sh 6.10`.

### Submitting a PR for a version update

If you'd like to help us by submitting a PR for a version update, please do the following:

1. [Fork this project.](https://help.github.com/en/github/getting-started-with-github/fork-a-repo)
1. [Clone the forked repository.](https://help.github.com/en/github/creating-cloning-and-archiving-repositories/cloning-a-repository)
1. Create a branch for the update PR. For example, `git checkout master; git checkout -b version-update`.
1. Run `./update.sh`. You can see additional options by using accessing the built-in help documentation with `./update.sh -h`. This script will automatically update the appropriate files with the latest versions and checksums.
1. Commit the modified files to the `version-update` branch and push the branch to your fork.
1. [Create a PR to merge the branch from your fork into this project's master branch.](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request-from-a-fork).
If you'd like to help us by submitting a PR for a version update, please do the
following:

1. [Fork this
project.](https://help.github.com/en/github/getting-started-with-github/fork-a-repo)
1. [Clone the forked
repository.](https://help.github.com/en/github/creating-cloning-and-archiving-repositories/cloning-a-repository)
1. Create a branch for the update PR. For example, `git checkout master; git
checkout -b version-update`.
1. Run `./update.sh`. You can see additional options by using accessing the
built-in help documentation with `./update.sh -h`. This script will
automatically update the appropriate files with the latest versions and
checksums.
1. Commit the modified files to the `version-update` branch and push the branch
to your fork.
1. [Create a PR to merge the branch from your fork into this project's master
branch.](https://help.github.com/en/github/collaborating-with-issues-and-pull-requests/creating-a-pull-request-from-a-fork).

## Adding dependencies to the base images

NodeJS is a big ecosystem with a variety of different use cases. The docker images for node are designed to provide the minimum for running core node. Additional dependencies (including dependencies for npm or yarn such as git) will not be included in these base images and will need to be included in descendent image.
NodeJS is a big ecosystem with a variety of different use cases. The docker
images for node are designed to provide the minimum for running core node.
Additional dependencies (including dependencies for npm or yarn such as git)
will not be included in these base images and will need to be included in
descendent image.
2 changes: 0 additions & 2 deletions GOVERNANCE.md
Original file line number Diff line number Diff line change
Expand Up @@ -111,8 +111,6 @@ If an agenda item cannot reach a consensus a WG member can call for a
closing vote. The call for a vote must be seconded by a majority of
the WG or else the discussion will continue. Simple majority wins.

<a id="developers-certificate-of-origin"></a>

## Developer's Certificate of Origin 1.1

By making a contribution to this project, I certify that:
Expand Down
104 changes: 56 additions & 48 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,18 @@

[![dockeri.co](http://dockeri.co/image/_/node)](https://registry.hub.docker.com/_/node/)

[![GitHub issues](https://img.shields.io/github/issues/nodejs/docker-node.svg "GitHub issues")](https://github.com/nodejs/docker-node)
[![GitHub stars](https://img.shields.io/github/stars/nodejs/docker-node.svg "GitHub stars")](https://github.com/nodejs/docker-node)
[![GitHub issues](https://img.shields.io/github/issues/nodejs/docker-node.svg
"GitHub issues")](https://github.com/nodejs/docker-node) [![GitHub
stars](https://img.shields.io/github/stars/nodejs/docker-node.svg "GitHub
stars")](https://github.com/nodejs/docker-node)

The official Node.js docker image, made with love by the node community.

<!-- START doctoc generated TOC please keep comment here to allow auto update -->
<!-- DON'T EDIT THIS SECTION, INSTEAD RE-RUN doctoc TO UPDATE -->
## Table of Contents

- [What is Node.js?](#what-is-nodejs)
- [What is Node.js](#what-is-nodejs)
- [How to use this image](#how-to-use-this-image)
- [Create a `Dockerfile` in your Node.js app project](#create-a-dockerfile-in-your-nodejs-app-project)
- [Best Practices](#best-practices)
Expand All @@ -31,18 +33,18 @@ The official Node.js docker image, made with love by the node community.
- [Docker Working Group Members](#docker-working-group-members)
- [Docker Working Group Collaborators](#docker-working-group-collaborators)
- [Emeritus](#emeritus)
- [Docker Working Group Members](#docker-working-group-members-1)
- [Emeritus Docker Working Group Members](#emeritus-docker-working-group-members)

<!-- END doctoc generated TOC please keep comment here to allow auto update -->

## What is Node.js?
## What is Node.js

Node.js is a platform built on Chrome's JavaScript runtime for easily building
fast, scalable network applications. Node.js uses an event-driven, non-blocking
I/O model that makes it lightweight and efficient, perfect for data-intensive
real-time applications that run across distributed devices.

See: http://nodejs.org
See: <http://nodejs.org>

## How to use this image

Expand All @@ -58,8 +60,8 @@ EXPOSE 8888
You can then build and run the Docker image:

```console
$ docker build -t my-nodejs-app .
$ docker run -it --rm --name my-running-app my-nodejs-app
docker build -t my-nodejs-app .
docker run -it --rm --name my-running-app my-nodejs-app
```

If you prefer Docker Compose:
Expand All @@ -83,16 +85,18 @@ services:
You can then run using Docker Compose:
```console
$ docker-compose up -d
docker-compose up -d
```

Docker Compose example copies your current directory (including node_modules) to the container.
It assumes that your application has a file named [`package.json`](https://docs.npmjs.com/files/package.json)
defining [start script](https://docs.npmjs.com/misc/scripts#default-values).
Docker Compose example copies your current directory (including node_modules) to
the container. It assumes that your application has a file named
[`package.json`](https://docs.npmjs.com/files/package.json) defining [start
script](https://docs.npmjs.com/misc/scripts#default-values).

### Best Practices

We have assembled a [Best Practices Guide](./docs/BestPractices.md) for those using these images on a daily basis.
We have assembled a [Best Practices Guide](./docs/BestPractices.md) for those
using these images on a daily basis.

### Run a single Node.js script

Expand All @@ -101,16 +105,18 @@ complete `Dockerfile`. In such cases, you can run a Node.js script by using the
Node.js Docker image directly:

```console
$ docker run -it --rm --name my-running-script -v "$PWD":/usr/src/app -w /usr/src/app node:8 node your-daemon-or-script.js
docker run -it --rm --name my-running-script -v "$PWD":/usr/src/app \
-w /usr/src/app node:8 node your-daemon-or-script.js
```

### Verbosity

Prior to 8.7.0 and 6.11.4 the docker images overrode the default npm log
level from `warn` to `info`. However due to improvements to npm and new Docker
patterns (e.g. multi-stage builds) the working group reached a [consensus](https://github.com/nodejs/docker-node/issues/528)
to revert the log level to npm defaults. If you need more verbose output, please
use one of the following methods to change the verbosity level.
Prior to 8.7.0 and 6.11.4 the docker images overrode the default npm log level
from `warn` to `info`. However due to improvements to npm and new Docker
patterns (e.g. multi-stage builds) the working group reached a
[consensus](https://github.com/nodejs/docker-node/issues/528) to revert the log
level to npm defaults. If you need more verbose output, please use one of the
following methods to change the verbosity level.

#### Dockerfile

Expand All @@ -129,7 +135,7 @@ If you run the node image using `docker run` you can use the `-e` flag to
override `NPM_CONFIG_LOGLEVEL`.

```console
$ docker run -e NPM_CONFIG_LOGLEVEL=info node ...
docker run -e NPM_CONFIG_LOGLEVEL=info node ...
```

#### NPM run
Expand All @@ -138,7 +144,7 @@ If you are running npm commands you can use `--loglevel` to control the
verbosity of the output.

```console
$ docker run node npm --loglevel=warn ...
docker run node npm --loglevel=warn ...
```

## Image Variants
Expand All @@ -147,8 +153,8 @@ The `node` images come in many flavors, each designed for a specific use case.
All of the images contain pre-installed versions of `node`,
[`npm`](https://www.npmjs.com/), and [`yarn`](https://yarnpkg.com). For each
supported architecture, the supported variants are different. In the file:
[architectures](./architectures), it lists all supported variants for all of
the architectures that we support now.
[architectures](./architectures), it lists all supported variants for all of the
architectures that we support now.

### `node:<version>`

Expand All @@ -164,31 +170,32 @@ need to install, thus reducing the overall size of all images on your system.

### `node:alpine`

This image is based on the popular
[Alpine Linux project](http://alpinelinux.org), available in
[the `alpine` official image](https://hub.docker.com/_/alpine). Alpine Linux is
much smaller than most distribution base images (~5MB), and thus leads to much
slimmer images in general.
This image is based on the popular [Alpine Linux
project](http://alpinelinux.org), available in [the `alpine` official
image](https://hub.docker.com/_/alpine). Alpine Linux is much smaller than most
distribution base images (~5MB), and thus leads to much slimmer images in
general.

This variant is highly recommended when final image size being as small as
possible is desired. The main caveat to note is that it does use
[musl libc](http://www.musl-libc.org) instead of
[glibc and friends](http://www.etalabs.net/compare_libcs.html), so certain
software might run into issues depending on the depth of their libc
requirements. However, most software doesn't have an issue with this, so this
variant is usually a very safe choice. See
[this Hacker News comment thread](https://news.ycombinator.com/item?id=10782897)
for more discussion of the issues that might arise and some pro/con comparisons
of using Alpine-based images. One common issue that may arise is a missing shared
library required for use of `process.dlopen`. To add the missing shared libraries
to your image, adding the [`libc6-compat`](https://pkgs.alpinelinux.org/package/edge/main/x86/libc6-compat)
possible is desired. The main caveat to note is that it does use [musl
libc](http://www.musl-libc.org) instead of [glibc and
friends](http://www.etalabs.net/compare_libcs.html), so certain software might
run into issues depending on the depth of their libc requirements. However, most
software doesn't have an issue with this, so this variant is usually a very safe
choice. See [this Hacker News comment
thread](https://news.ycombinator.com/item?id=10782897) for more discussion of
the issues that might arise and some pro/con comparisons of using Alpine-based
images. One common issue that may arise is a missing shared library required for
use of `process.dlopen`. To add the missing shared libraries to your image,
adding the
[`libc6-compat`](https://pkgs.alpinelinux.org/package/edge/main/x86/libc6-compat)
package in your Dockerfile is recommended: `apk add --no-cache libc6-compat`

To minimize image size, it's uncommon for additional related tools
(such as `git` or `bash`) to be included in Alpine-based images. Using this
image as a base, add the things you need in your own Dockerfile
(see the [`alpine` image description](https://hub.docker.com/_/alpine/) for
examples of how to install packages if you are unfamiliar).
To minimize image size, it's uncommon for additional related tools (such as
`git` or `bash`) to be included in Alpine-based images. Using this image as a
base, add the things you need in your own Dockerfile (see the [`alpine` image
description](https://hub.docker.com/_/alpine/) for examples of how to install
packages if you are unfamiliar).

### `node:slim`

Expand Down Expand Up @@ -217,14 +224,15 @@ upgrade your Docker daemon.

## Supported Node.js versions

This project will support Node.js versions as still under active support as per the [Node.js release schedule](https://github.com/nodejs/Release).
This project will support Node.js versions as still under active support as per
the [Node.js release schedule](https://github.com/nodejs/Release).

## Governance and Current Members

The Node.js Docker Image is governed by the Docker Working Group. See
[GOVERNANCE.md](https://github.com/nodejs/docker-node/blob/master/GOVERNANCE.md)
to learn more about the group's structure and [CONTRIBUTING.md](CONTRIBUTING.md) for guidance
about the expectations for all contributors to this project.
to learn more about the group's structure and [CONTRIBUTING.md](CONTRIBUTING.md)
for guidance about the expectations for all contributors to this project.

### Docker Working Group Members

Expand All @@ -242,6 +250,6 @@ about the expectations for all contributors to this project.

### Emeritus

#### Docker Working Group Members
#### Emeritus Docker Working Group Members

- Christopher Horrell ([chorrell](https://github.com/chorrell))
Loading

0 comments on commit 2e23cbd

Please sign in to comment.