-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile
68 lines (48 loc) · 1.77 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
FROM ubuntu:14.04
MAINTAINER Gizra <[email protected]>
# Disable interactive mode
ENV DEBIAN_FRONTEND=noninteractive
# Update list of packages and install packages
RUN apt-get update
RUN apt-get install -y curl git graphicsmagick jq php5-cli php5-curl
# Install NodeJS and NPM
RUN curl -sSL https://deb.nodesource.com/setup | bash -
RUN apt-get install -y nodejs
# Install mocha
RUN npm install -g mocha
# Change working directory to install software manually
WORKDIR /usr/local/bin
# Install hub
RUN curl -sSL https://github.com/github/hub/releases/download/v2.2.0/hub-linux-amd64-2.2.0.tar.gz | tar zx && ln -s hub-linux-amd64-2.2.0/hub
# Install composer globally
RUN curl -sSL https://getcomposer.org/installer | php && mv composer.phar composer
# Create "shoov" user with crypted password "shoov"
RUN useradd -d /home/shoov -m -s /bin/bash shoov
RUN echo "shoov:shoov" | chpasswd
# Add "shoov" to "sudoers"
RUN echo "shoov ALL=(ALL:ALL) ALL" >> /etc/sudoers
# Change working directory to home directory of shoov user
WORKDIR /home/shoov
# Enable ssh-agent
RUN eval `ssh-agent -s`
RUN mkdir build && chmod 777 build
# Create known_hosts
RUN mkdir .ssh && touch .ssh/known_hosts
# Add Github key
RUN ssh-keyscan -H github.com > .ssh/known_hosts
# Add scripts in a temp folder, so Docker will cache it
RUN mkdir /temp-node-modules
ADD package.json /temp-node-modules/package.json
RUN cd /temp-node-modules && npm install --verbose
RUN cp -R /temp-node-modules/node_modules /home/shoov
# Add scripts
ADD build_info.js /home/shoov/build_info.js
ADD main.sh /home/shoov/main.sh
ADD parse.js /home/shoov/parse.js
ADD export-vars.js /home/shoov/export-vars.js
# Fix permissions
RUN chown -R shoov:shoov /home/shoov
USER shoov
ENV HOME /home/shoov
ENV PATH $PATH:/home/shoov
CMD ["/home/shoov/main.sh"]