Compare commits
80 Commits
Author | SHA1 | Date | |
---|---|---|---|
b1814a60d5 | |||
aed0fee59f | |||
fc53a7e3f0 | |||
6ee919ac34 | |||
1b8680edff | |||
67f4456073 | |||
b2835bd220 | |||
a0a2cc2eda | |||
e8c24d504c | |||
866346a0a5 | |||
04ea46f681 | |||
cd858ae9fa | |||
dc28ada99a | |||
09c78e9577 | |||
7525d1af5c | |||
043651bfac | |||
621fff81c3 | |||
b0e8ff164f | |||
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:latest
|
||||
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
|
||||
tags:
|
||||
- lossless
|
||||
- priv
|
||||
|
||||
release:
|
||||
stage: release
|
||||
script:
|
||||
- npmci publish docker
|
||||
only:
|
||||
- tags
|
||||
- triggers
|
||||
tags:
|
||||
- lossless
|
||||
- priv
|
||||
|
||||
trigger:
|
||||
stage: trigger
|
||||
script:
|
||||
- npmci trigger
|
||||
only:
|
||||
- tags
|
||||
- triggers
|
||||
tags:
|
||||
- lossless
|
||||
- priv
|
47
Dockerfile
47
Dockerfile
@ -1,36 +1,37 @@
|
||||
FROM debian
|
||||
FROM ubuntu:latest
|
||||
|
||||
# Replace shell with bash so we can source files
|
||||
RUN rm /bin/sh && ln -s /bin/bash /bin/sh
|
||||
# important environment variables
|
||||
ENV NODE_VERSION_LTS="6.9.1" NODE_VERSION_STABLE="7.1.0" NVM_DIR="/usr/local/nvm"
|
||||
|
||||
# Set debconf to run non-interactively
|
||||
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections
|
||||
|
||||
# Install base dependencies
|
||||
RUN apt-get update && apt-get install -y -q --no-install-recommends \
|
||||
# Set debconf to run non-interactively and install packages
|
||||
RUN echo 'debconf debconf/frontend select Noninteractive' | debconf-set-selections \
|
||||
&& apt-get update \
|
||||
&& apt-get upgrade --no-install-recommends -y \
|
||||
&& apt-get install -y -q --no-install-recommends \
|
||||
software-properties-common \
|
||||
apt-transport-https \
|
||||
build-essential \
|
||||
ca-certificates \
|
||||
curl \
|
||||
git \
|
||||
libssl-dev \
|
||||
ssh \
|
||||
openssl \
|
||||
python \
|
||||
rsync \
|
||||
software-properties-common \
|
||||
wget \
|
||||
&& rm -rf /var/lib/apt/lists/*
|
||||
|
||||
ENV NVM_DIR /usr/local/nvm
|
||||
ENV NODE_VERSION 4.3.1
|
||||
&& curl -sS https://dl.yarnpkg.com/debian/pubkey.gpg | apt-key add - \
|
||||
&& echo "deb https://dl.yarnpkg.com/debian/ stable main" | tee /etc/apt/sources.list.d/yarn.list \
|
||||
&& apt-get update \
|
||||
&& apt-get install yarn -y \
|
||||
&& apt-get clean \
|
||||
&& rm -r /var/lib/apt/lists/*
|
||||
|
||||
# Install nvm with node and npm
|
||||
RUN curl https://raw.githubusercontent.com/creationix/nvm/v0.31.0/install.sh | bash \
|
||||
&& source $NVM_DIR/nvm.sh \
|
||||
&& nvm install $NODE_VERSION \
|
||||
&& nvm alias default $NODE_VERSION \
|
||||
&& nvm use default
|
||||
&& bash -c "source $NVM_DIR/nvm.sh \
|
||||
&& nvm install $NODE_VERSION_STABLE \
|
||||
&& nvm alias default $NODE_VERSION_STABLE \
|
||||
&& nvm use default \
|
||||
&& npm install -g npm"
|
||||
|
||||
ENV NODE_PATH $NVM_DIR/v$NODE_VERSION/lib/node_modules
|
||||
ENV PATH $NVM_DIR/versions/node/v$NODE_VERSION/bin:$PATH
|
||||
RUN node -v
|
||||
RUN npm -v
|
||||
ENV NODE_PATH $NVM_DIR/v$NODE_VERSION_STABLE/lib/node_modules
|
||||
ENV PATH $NVM_DIR/versions/node/v$NODE_VERSION_STABLE/bin:$PATH
|
||||
|
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
|
5
Dockerfile_mongo
Normal file
5
Dockerfile_mongo
Normal file
@ -0,0 +1,5 @@
|
||||
FROM hosttoday/ht-docker-node:npmts
|
||||
RUN apt-key adv --keyserver hkp://keyserver.ubuntu.com:80 --recv EA312927 \
|
||||
&& echo "deb http://repo.mongodb.org/apt/ubuntu xenial/mongodb-org/3.2 multiverse" | tee /etc/apt/sources.list.d/mongodb-org-3.2.list \
|
||||
&& apt-get update \
|
||||
&& apt-get install -y mongodb-org
|
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
|
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
|
||||
* **:mongo** - npmci + npmts + mongo
|
@ -1,6 +1,6 @@
|
||||
{
|
||||
"name": "ht-docker-node",
|
||||
"version": "4.3.1",
|
||||
"version": "4.3.8",
|
||||
"description": "docker image with nodejs with shipzone.io support",
|
||||
"main": "index.js",
|
||||
"scripts": {
|
||||
|
9
test/test_latest.sh
Normal file
9
test/test_latest.sh
Normal file
@ -0,0 +1,9 @@
|
||||
#!/bin/sh
|
||||
|
||||
# test availability of node and npm
|
||||
npm -v
|
||||
node -v
|
||||
|
||||
# test yarn
|
||||
yarn global add npmts
|
||||
npmts -v
|
9
test/test_npmci.sh
Normal file
9
test/test_npmci.sh
Normal file
@ -0,0 +1,9 @@
|
||||
# check if npmci is available
|
||||
npmci -v
|
||||
|
||||
# check if we can use lts
|
||||
npmci install lts
|
||||
|
||||
# check if yarn picks it up
|
||||
npmci command yarn global add npmts
|
||||
npmci command npmts -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