Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
9 changes: 9 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
sudo: required

services:
- docker

script:
- make test
notifications:
email: false
51 changes: 51 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
FROM ubuntu:14.04

MAINTAINER MagicVision Team

RUN apt-get update -y

# Install nvm
RUN apt-get install -y curl build-essential libssl-dev man && \
curl https://raw.githubusercontent.com/creationix/nvm/v0.16.1/install.sh | sh

# Install node.js 4.1.0
RUN bash -ic "nvm install 4.1.0" && \
bash -ic "nvm alias default 4.1.0" && \
bash -ic "nvm use 4.1.0"

# Use Taobao node mirror and npm registry
ENV NVM_NODEJS_ORG_MIRROR=http://npm.taobao.org/mirrors/node
RUN /root/.nvm/v4.1.0/bin/npm config set registry http://registry.npm.taobao.org

# Provisioning gitlab CA
ADD gitlab-CA.crt /usr/local/share/ca-certificates/
RUN update-ca-certificates

# Install docker-cli
# See https://github.com/docker-library/docker/blob/bb15fc25bbd4f51a880cf02f91eab447b1083b75/1.8/Dockerfile
ENV DOCKER_BUCKET get.docker.com
ENV DOCKER_VERSION 1.8.2
ENV DOCKER_SHA256 97a3f5924b0b831a310efa8bf0a4c91956cd6387c4a8667d27e2b2dd3da67e4d
RUN curl -fSL "https://${DOCKER_BUCKET}/builds/Linux/x86_64/docker-$DOCKER_VERSION" -o /usr/local/bin/docker && \
echo "${DOCKER_SHA256} /usr/local/bin/docker" | sha256sum -c - && \
chmod +x /usr/local/bin/docker

# Install ruby and sass
RUN apt-get install -y ruby && gem install sass

# Install git
RUN apt-get install -y git

# Install python
RUN apt-get install -y python

# Use tsinghua ubuntu mirror
RUN echo "deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ trusty main restricted universe multiverse" > /etc/apt/sources.list && \
echo "deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ trusty-security main restricted universe multiverse" >> /etc/apt/sources.list && \
echo "deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ trusty-updates main restricted universe multiverse" >> /etc/apt/sources.list && \
echo "deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ trusty-proposed main restricted universe multiverse" >> /etc/apt/sources.list && \
echo "deb http://mirrors.tuna.tsinghua.edu.cn/ubuntu/ trusty-backports main restricted universe multiverse" >> /etc/apt/sources.list && \
apt-get update -y

COPY ./entrypoint.sh /
ENTRYPOINT ["/entrypoint.sh"]
10 changes: 10 additions & 0 deletions Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
SHELL = /bin/bash -o pipefail

test:
docker build -t magicvision/nodejs-dev .
docker run --rm magicvision/nodejs-dev node --version
docker run --rm magicvision/nodejs-dev npm --version
docker run --rm magicvision/nodejs-dev ruby --version
docker run --rm magicvision/nodejs-dev sass --version
docker run --rm magicvision/nodejs-dev git --version
docker run --rm magicvision/nodejs-dev python --version
27 changes: 27 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,27 @@
# docker-nodejs-dev

> MagicVision nodejs development env based on Docker

[![Build Status](https://travis-ci.org/GetMagicVision/docker-nodejs-dev.svg)](https://travis-ci.org/GetMagicVision/docker-nodejs-dev)
[![Docker image layers and size](https://badge.imagelayers.io/magicvision/nodejs-dev:latest.svg)](https://imagelayers.io/?images=magicvision/nodejs-dev:latest 'Get your own badge on imagelayers.io')

## Features

- Docker support with [docker:dind][]
- node.js 4.1.0 with npm
- Ruby 1.9.1 with gem 1.8.23
- [Saas][] 3.4.18
- git 1.9.1
- python 2.7.6

[docker:dind]: https://hub.docker.com/_/docker/#
[Saas]: https://github.com/sass/sass

## Getting Started

docker run --privileged --name docker-host -d docker:1.8-dind
docker run -it --link docker-host:docker magicvision/nodejs-dev /bin/bash

## License

MIT license
12 changes: 12 additions & 0 deletions entrypoint.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
#!/bin/bash

# activate nvm
export NVM_DIR="/root/.nvm"
[ -s "$NVM_DIR/nvm.sh" ] && . "$NVM_DIR/nvm.sh"

# if we have "--link some-docker:docker" and not DOCKER_HOST, let's set DOCKER_HOST automatically
if [ -z "$DOCKER_HOST" -a "$DOCKER_PORT_2375_TCP" ]; then
export DOCKER_HOST='tcp://docker:2375'
fi

exec "$@"
20 changes: 20 additions & 0 deletions gitlab-CA.crt
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
-----BEGIN CERTIFICATE-----
MIIDSDCCAjACCQDGDwoeolFhaTANBgkqhkiG9w0BAQsFADBjMQswCQYDVQQGEwJD
TjERMA8GA1UECAwISmlhbmcgU3UxETAPBgNVBAcMCE5hbiBKaW5nMQ8wDQYDVQQK
DAZDSWVORVQxDDAKBgNVBAsMA0lQQTEPMA0GA1UEAwwGSVBBIENBMB4XDTE1MDcw
OTAyMzg0MVoXDTE2MDcwODAyMzg0MVowaTELMAkGA1UEBhMCQ04xETAPBgNVBAgM
CEppYW5nIFN1MREwDwYDVQQHDAhOYW4gSmluZzEPMA0GA1UECgwGQ0llTkVUMQww
CgYDVQQLDANJUEExFTATBgNVBAMMDCouaXBhLnNvY2lhbDCCASIwDQYJKoZIhvcN
AQEBBQADggEPADCCAQoCggEBAKaHIOMG0ZM7xsEEEPkAvPjrUsN5kAjRPHJY8gJJ
fVJTNffbngIyGbUAAQ+LYAWuek0LOwaYEuNysD0Bfhy9/AG4GGkxMGuchSpdpc+M
4CwWa5Szf3SOKD+biNXC1zRdpb881KBy05kSN5g9DnCODSgrtv8xedP9vm+vUG6H
bC2qDY7VTpZmW/BerzzIzH3OvpvhkB9aHTJDvhjDb6eQjw/velQiZl7sSnPnGbGm
Yu+ZetWjN+DjqMyDU6N+8MkdppkD4/V78ogF9QqXtNcyeJKrjlHq2xMQZeuOPYy4
fH50rh6hUW/jvppqcZVGkSZX3QcSe3zyGqQKxnfRN3Rwv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