Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/simbo/docker-node
Docker images with node and yarn and some opinionated optimizations.
https://github.com/simbo/docker-node
berlin debian docker docker-images docker-node node-gyp nodejs
Last synced: 4 days ago
JSON representation
Docker images with node and yarn and some opinionated optimizations.
- Host: GitHub
- URL: https://github.com/simbo/docker-node
- Owner: simbo
- License: mit
- Created: 2017-07-13T22:18:56.000Z (over 7 years ago)
- Default Branch: master
- Last Pushed: 2021-03-13T10:07:22.000Z (almost 4 years ago)
- Last Synced: 2024-11-20T12:35:52.450Z (2 months ago)
- Topics: berlin, debian, docker, docker-images, docker-node, node-gyp, nodejs
- Language: Shell
- Homepage: https://hub.docker.com/r/simbo/node/
- Size: 70.3 KB
- Stars: 0
- Watchers: 2
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
docker-node
===========> Docker images with node.js and some opinionated settings.
[![GitHub Workflow Status](https://img.shields.io/github/workflow/status/simbo/docker-node/CI)](https://github.com/simbo/docker-node/actions?query=workflow%3ACI)
[![Docker Pulls](https://img.shields.io/docker/pulls/simbo/node.svg)](https://hub.docker.com/r/simbo/node)These images are derivates of the [official node images](https://hub.docker.com/_/node/)
with the following changes:- timezone set to "Europe/Berlin"
- simple prompt with current path and docker image name
- yarn self-update check disabled
- yarn cache as persistent volume (`/yarn-cache`)
- nano installed and set as default editorBeside the same variations like the original node image, there is also a `*-gyp`
version available, which includes all requirements to use [node-gyp](https://github.com/nodejs/node-gyp):- `simbo/node:` (debian buster with common libs)
- `simbo/node:-slim` (minimum debian buster with curl)
- `simbo/node:-gyp` (slim with node-gyp requirements)
- `simbo/node:-alpine` (alpine)```sh
docker pull simbo/node:
docker pull simbo/node:-slim
docker pull simbo/node:-gyp
docker pull simbo/node:-alpine
```It is not recommended to use images with the tag `latest` as they refer to the
latest build and not necessarily to the latest version.See the [tags list](https://hub.docker.com/r/simbo/node/tags/) for all available
image versions.### Using the Yarn Cache Volume
With the `docker` command:
```sh
docker run --rm -it -v yarn-cache:/yarn-cache simbo/node bash
```With `docker-compose`:
```yml
version: "3.9"
volumes:
yarn-cache:
services:
app:
image: simbo/node
volumes:
- yarn-cache:/yarn-cache
```## Development
### Local Builds for Testing
```sh
# build default image
docker build -f Dockerfile -t test-simbo/node .
# build slim image
docker build -f Dockerfile-slim -t test-simbo/node-slim .
# build gyp image
docker build -f Dockerfile-gyp -t test-simbo/node-gyp .
# build alpine image
docker build -f Dockerfile-alpine -t test-simbo/node-alpine .# run default image with login shell
docker run --rm -it test-simbo/node bash
# run slim image with login shell
docker run --rm -it test-simbo/node-slim bash
# run gyp image with login shell
docker run --rm -it test-simbo/node-gyp bash
# run alpine image with login shell
docker run --rm -it test-simbo/node-alpine sh -l# remove images afterwars
docker image rm test-simbo/node test-simbo/node-slim test-simbo/node-gyp test-simbo/node-alpine# optionally: clear everything docker from your system
docker system prune -a
```### Releasing new Versions
Use the release script `release-version` for automatically updating dockerfiles
and triggering new image releases using GitHub Actions and Docker Hub.Usage: `./release-version `
Example: `./release-version 10.23.0`
Example output:
```txt
# ./release-version 10.23.0📦 Publish new Versions for simbo/docker-node
This script will update all dockerfiles in this repository to
node.js v10.23.0
Changes will be committed, tagged with 10.23.0 and pushed to GitHub.
This push should trigger GitHub Actions, where images will be built and released to Docker Hub, where they will be tagged with 10, 10.23 and 10.23.0.Press [ENTER] to continue or anything else to cancel.
[master c012125] node.js v10.23.0
4 files changed, 4 insertions(+), 4 deletions(-)
Objekte aufzählen: 25, fertig.
Zähle Objekte: 100% (25/25), fertig.
Delta-Kompression verwendet bis zu 4 Threads.
Komprimiere Objekte: 100% (19/19), fertig.
Schreibe Objekte: 100% (19/19), 2.23 KiB | 1.12 MiB/s, fertig.
Gesamt 19 (Delta 12), Wiederverwendet 0 (Delta 0), Pack wiederverwendet 0
remote: Resolving deltas: 100% (12/12), completed with 6 local objects.
To github.com:simbo/docker-node.git
b498c44..c012125 master -> master
* [new tag] 10.23.0 -> 10.23.0✅ All done.
See GitHub Actions for CI details: https://github.com/simbo/docker-node/actions
See Docker Hub for released images: https://hub.docker.com/r/simbo/node/tags
```## License and Author
[MIT © Simon Lepel](http://simbo.mit-license.org/)