-
Notifications
You must be signed in to change notification settings - Fork 18
/
Dockerfile
70 lines (54 loc) · 1.85 KB
/
Dockerfile
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
# Docker development environment for express-processimage
#
# This Dockerfile is for development only.
#
# It is built to closely resemble the Travis CI environment, to make the
# development experience as flawless as possible.
#
# Based on https://github.com/creationix/nvm/blob/a1abfd1fe42308599b77461eb15460427fe05b9e/Dockerfile#L16
FROM ubuntu:14.04
LABEL maintainer="Gustav Nikolaj <gustavnikolaj@gmail.com>"
LABEL name="express-processimage-dev"
LABEL version="latest"
# Set the SHELL to bash with pipefail option
SHELL ["/bin/bash", "-o", "pipefail", "-c"]
# Prevent dialog during apt install
ENV DEBIAN_FRONTEND noninteractive
# Pick a Ubuntu apt mirror site for better speed
# ref: https://launchpad.net/ubuntu/+archivemirrors
ENV UBUNTU_APT_SITE mirror.one.com
# Disable src package source
RUN sed -i 's/^deb-src\ /\#deb-src\ /g' /etc/apt/sources.list
# Replace origin apt package site with the mirror site
RUN sed -E -i "s/([a-z]+.)?archive.ubuntu.com/$UBUNTU_APT_SITE/g" /etc/apt/sources.list
RUN sed -i "s/security.ubuntu.com/$UBUNTU_APT_SITE/g" /etc/apt/sources.list
# Install apt packages
RUN apt-get update && \
apt-get install -y \
git \
wget \
optipng \
pngcrush \
pngquant \
graphicsmagick \
libjpeg-turbo-progs \
inkscape \
libcairo2-dev \
libgif-dev \
libjpeg8-dev \
zlib1g-dev
# Set locale
RUN locale-gen en_US.UTF-8
# Add user "nvm" as non-root user
RUN useradd -ms /bin/bash nvm
# Set sudoer for "nvm"
RUN echo 'nvm ALL=(ALL) NOPASSWD: ALL' >> /etc/sudoers
# Switch to user "nvm" from now
USER nvm
# nvm
RUN wget -qO- https://raw.githubusercontent.com/creationix/nvm/v0.34.0/install.sh | bash
# Set WORKDIR to nvm directory
WORKDIR /home/nvm/express-processimage
# Install node version 8 (keep in sync with .travis.yml)
RUN bash -c 'source $HOME/.nvm/nvm.sh && nvm install 8'
ENTRYPOINT ["/bin/bash"]