Compare commits
62 Commits
Author | SHA1 | Date | |
---|---|---|---|
21ce311be3 | |||
c030b94bc6 | |||
221fd422d6 | |||
04e29ffd5e | |||
bc58522b12 | |||
42760d7aeb | |||
a93e26ce98 | |||
a442040021 | |||
87678e9bf4 | |||
23a4df0c35 | |||
2fe58c23c3 | |||
40fa047c24 | |||
e8c45ba38b | |||
22adbef520 | |||
774a9a3e91 | |||
f829c38137 | |||
6f27262366 | |||
5ee60a65d6 | |||
97f371890b | |||
8630f4920d | |||
cefe591b2a | |||
87bc1f267a | |||
ced7c75cba | |||
371c7c11ea | |||
a112bba2e1 | |||
9aff193ef9 | |||
37e997ebf2 | |||
864ebf39a8 | |||
27b65ae64a | |||
cf8f10d032 | |||
9e10b04105 | |||
5d0fc29252 | |||
d27f9f11ae | |||
10bb62cc01 | |||
886211f908 | |||
e49776862e | |||
2c6ffe34fc | |||
56a1bc4e0f | |||
2d0bc35096 | |||
fc8de3e5d1 | |||
dfaf401f1b | |||
6ad80e7aa9 | |||
99c9645108 | |||
6499eedc7b | |||
4c75ba6e3f | |||
53c013da51 | |||
fd432a3f16 | |||
c8a92cc2e2 | |||
d6ac184f9f | |||
c8db76b050 | |||
c587638b90 | |||
e20c79b3ab | |||
ae78db3097 | |||
e5ad68e7ca | |||
6bd6665f63 | |||
19deb73114 | |||
e08088c520 | |||
30c57e2f3a | |||
c81f3446c2 | |||
b4e13ceffe | |||
b8d3094ad7 | |||
f3b85d94eb |
54
.gitlab-ci.yml
Normal file
54
.gitlab-ci.yml
Normal file
@ -0,0 +1,54 @@
|
|||||||
|
image: hosttoday/ht-docker-dbase
|
||||||
|
services:
|
||||||
|
- docker:dind
|
||||||
|
|
||||||
|
stages:
|
||||||
|
- build
|
||||||
|
- test
|
||||||
|
- release
|
||||||
|
- trigger
|
||||||
|
|
||||||
|
before_script:
|
||||||
|
- npm uninstall -g npmci
|
||||||
|
- npm install -g npmci
|
||||||
|
- npmci prepare docker
|
||||||
|
|
||||||
|
|
||||||
|
build:
|
||||||
|
stage: build
|
||||||
|
script:
|
||||||
|
- npmci build docker
|
||||||
|
tags:
|
||||||
|
- lossless
|
||||||
|
- priv
|
||||||
|
|
||||||
|
|
||||||
|
test:
|
||||||
|
stage: test
|
||||||
|
script:
|
||||||
|
- npmci test docker
|
||||||
|
only:
|
||||||
|
- tags
|
||||||
|
tags:
|
||||||
|
- lossless
|
||||||
|
- priv
|
||||||
|
|
||||||
|
release:
|
||||||
|
stage: release
|
||||||
|
script:
|
||||||
|
- npmci publish docker
|
||||||
|
only:
|
||||||
|
- tags
|
||||||
|
tags:
|
||||||
|
- lossless
|
||||||
|
- priv
|
||||||
|
|
||||||
|
trigger:
|
||||||
|
stage: trigger
|
||||||
|
script:
|
||||||
|
- npmci trigger
|
||||||
|
only:
|
||||||
|
- tags
|
||||||
|
tags:
|
||||||
|
- lossless
|
||||||
|
- priv
|
43
Dockerfile
43
Dockerfile
@ -1,36 +1,33 @@
|
|||||||
FROM debian
|
FROM ubuntu:latest
|
||||||
|
|
||||||
# Replace shell with bash so we can source files
|
# important environment variables
|
||||||
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
|
ENV NODE_VERSION_LTS="4.4.7" NODE_VERSION_STABLE="6.3.0" NVM_DIR="/usr/local/nvm"
|
||||||
|
|
||||||
# Set debconf to run non-interactively
|
# Set debconf to run non-interactively and install packages
|
||||||
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
|
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections \
|
||||||
|
&& apt-get update \
|
||||||
# Install base dependencies
|
&& apt-get upgrade --no-install-recommends -y \
|
||||||
RUN apt-get update && apt-get install -y -q --no-install-recommends \
|
&& apt-get install -y -q --no-install-recommends \
|
||||||
|
software-properties-common \
|
||||||
apt-transport-https \
|
apt-transport-https \
|
||||||
build-essential \
|
build-essential \
|
||||||
ca-certificates \
|
ca-certificates \
|
||||||
curl \
|
curl \
|
||||||
git \
|
git \
|
||||||
libssl-dev \
|
ssh \
|
||||||
|
openssl \
|
||||||
python \
|
python \
|
||||||
rsync \
|
rsync \
|
||||||
software-properties-common \
|
&& apt-get clean \
|
||||||
wget \
|
&& rm -r /var/lib/apt/lists/*
|
||||||
&& rm -rf /var/lib/apt/lists/*
|
|
||||||
|
|
||||||
ENV NVM_DIR /usr/local/nvm
|
|
||||||
ENV NODE_VERSION 4.3.1
|
|
||||||
|
|
||||||
# Install nvm with node and npm
|
# Install nvm with node and npm
|
||||||
RUN curl https://raw.githubusercontent.com/creationix/nvm/v0.31.0/install.sh | bash \
|
RUN curl https://raw.githubusercontent.com/creationix/nvm/v0.31.0/install.sh | bash \
|
||||||
&& source $NVM_DIR/nvm.sh \
|
&& bash -c "source $NVM_DIR/nvm.sh \
|
||||||
&& nvm install $NODE_VERSION \
|
&& nvm install $NODE_VERSION_STABLE \
|
||||||
&& nvm alias default $NODE_VERSION \
|
&& nvm alias default $NODE_VERSION_STABLE \
|
||||||
&& nvm use default
|
&& nvm use default \
|
||||||
|
&& npm install -g npm"
|
||||||
|
|
||||||
ENV NODE_PATH $NVM_DIR/v$NODE_VERSION/lib/node_modules
|
ENV NODE_PATH $NVM_DIR/v$NODE_VERSION_STABLE/lib/node_modules
|
||||||
ENV PATH $NVM_DIR/versions/node/v$NODE_VERSION/bin:$PATH
|
ENV PATH $NVM_DIR/versions/node/v$NODE_VERSION_STABLE/bin:$PATH
|
||||||
RUN node -v
|
|
||||||
RUN npm -v
|
|
||||||
|
10
Dockerfile_lts
Normal file
10
Dockerfile_lts
Normal file
@ -0,0 +1,10 @@
|
|||||||
|
FROM hosttoday/ht-docker-node:latest
|
||||||
|
|
||||||
|
RUN bash -c "source $NVM_DIR/nvm.sh \
|
||||||
|
&& nvm install $NODE_VERSION_LTS \
|
||||||
|
&& nvm alias default $NODE_VERSION_LTS \
|
||||||
|
&& nvm use default \
|
||||||
|
&& npm install -g npm"
|
||||||
|
|
||||||
|
ENV NODE_PATH $NVM_DIR/v$NODE_VERSION_LTS/lib/node_modules
|
||||||
|
ENV PATH $NVM_DIR/versions/node/v$NODE_VERSION_LTS/bin:$PATH
|
2
Dockerfile_npmci
Normal file
2
Dockerfile_npmci
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
FROM hosttoday/ht-docker-node:latest
|
||||||
|
RUN npm install -g npmci
|
2
Dockerfile_npmdeploy
Normal file
2
Dockerfile_npmdeploy
Normal file
@ -0,0 +1,2 @@
|
|||||||
|
FROM hosttoday/ht-docker-node:npmci
|
||||||
|
RUN npm install -g npmdeploy
|
5
Dockerfile_npmpage
Normal file
5
Dockerfile_npmpage
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
FROM hosttoday/ht-docker-node:npmts
|
||||||
|
RUN npmci install stable && npmci command npm install -g npmpage && npmci command npmpage -v \
|
||||||
|
&& npmci install legacy && npmci command npm install -g npmpage && npmci command npmpage -v \
|
||||||
|
&& npmci install lts && npmci command npm install -g npmpage && npmci command npmpage -v \
|
||||||
|
&& npmci clean
|
5
Dockerfile_npmts
Normal file
5
Dockerfile_npmts
Normal file
@ -0,0 +1,5 @@
|
|||||||
|
FROM hosttoday/ht-docker-node:npmci
|
||||||
|
RUN npmci install stable && npmci command npm install -g npm npmts && npmci command npmts -v \
|
||||||
|
&& npmci install legacy && npmci command npm install -g npm npmts && npmci command npmts -v \
|
||||||
|
&& npmci install lts && npmci command npm install -g npm npmts && npmci command npmts -v \
|
||||||
|
&& npmci clean
|
13
Dockerfile_python3
Normal file
13
Dockerfile_python3
Normal file
@ -0,0 +1,13 @@
|
|||||||
|
FROM hosttoday/ht-docker-node:latest
|
||||||
|
RUN apt-get update \
|
||||||
|
&& apt-get install -y -q --no-install-recommends \
|
||||||
|
python3 \
|
||||||
|
&& apt-get clean \
|
||||||
|
&& rm -r /var/lib/apt/lists/*
|
||||||
|
|
||||||
|
# Install pip and symlink python to python3
|
||||||
|
RUN curl -O https://bootstrap.pypa.io/get-pip.py \
|
||||||
|
&& python3 get-pip.py \
|
||||||
|
&& rm get-pip.py \
|
||||||
|
&& rm -r /usr/bin/python \
|
||||||
|
&& ln -s /usr/bin/python3 /usr/bin/python
|
1
Dockerfile_stable
Normal file
1
Dockerfile_stable
Normal file
@ -0,0 +1 @@
|
|||||||
|
FROM hosttoday/ht-docker-node:latest
|
30
README.md
Normal file
30
README.md
Normal file
@ -0,0 +1,30 @@
|
|||||||
|
# ht-docker-node
|
||||||
|
|
||||||
|
This image is available on DockerHub. Specify it as base image like so:
|
||||||
|
|
||||||
|
```Dockerfile
|
||||||
|
FROM hosttoday/ht-docker-node
|
||||||
|
```
|
||||||
|
|
||||||
|
## Status
|
||||||
|
[](https://gitlab.com/hosttoday/ht-docker-node/commits/master)
|
||||||
|
|
||||||
|
## Usage
|
||||||
|
The purpose of this Docker image is to provide a robust base for node apps and CI.
|
||||||
|
It comes in different flavours and all of them have node, npm, git and ssh in PATH.
|
||||||
|
|
||||||
|
The **:npmci flavour** has npmci in path and can install any required node version and update PATH accordingly:
|
||||||
|
|
||||||
|
```Dockerfile
|
||||||
|
FROM hosttoday/ht-docker-node:npmci
|
||||||
|
RUN npmci install [node_version_number] // this installs node using node and sets the default to the new node and npm versions
|
||||||
|
```
|
||||||
|
|
||||||
|
## Flavour Overview:
|
||||||
|
|
||||||
|
* **:lts** - node lts version, equals :latest
|
||||||
|
* **:stable** - node stable version
|
||||||
|
* **:npmci** - npmci preinstalled
|
||||||
|
* **:npmts** - npmci + npmts preinstalled
|
||||||
|
* **:npmpage** - npmci + npmts + npmpage preinstalled
|
||||||
|
* **:python3** - like :latest, but with python3 as standard python version
|
@ -1,6 +1,6 @@
|
|||||||
{
|
{
|
||||||
"name": "ht-docker-node",
|
"name": "ht-docker-node",
|
||||||
"version": "4.3.1",
|
"version": "4.3.3",
|
||||||
"description": "docker image with nodejs with shipzone.io support",
|
"description": "docker image with nodejs with shipzone.io support",
|
||||||
"main": "index.js",
|
"main": "index.js",
|
||||||
"scripts": {
|
"scripts": {
|
||||||
|
3
test/test_latest.sh
Normal file
3
test/test_latest.sh
Normal file
@ -0,0 +1,3 @@
|
|||||||
|
#!/bin/sh
|
||||||
|
npm -v
|
||||||
|
node -v
|
1
test/test_npmci.sh
Normal file
1
test/test_npmci.sh
Normal file
@ -0,0 +1 @@
|
|||||||
|
npmci -v
|
6
test/test_npmts.sh
Normal file
6
test/test_npmts.sh
Normal file
@ -0,0 +1,6 @@
|
|||||||
|
npmci install stable
|
||||||
|
npmci command npmts -v
|
||||||
|
npmci install lts
|
||||||
|
npmci command npmts -v
|
||||||
|
npmci install legacy
|
||||||
|
npmci command npmts -v
|
Reference in New Issue
Block a user