Skip to content

Commit

Permalink
Merge pull request #1 from makeomatic/refactor/semaphore
Browse files Browse the repository at this point in the history
Refactor/semaphore
  • Loading branch information
AVVS authored Nov 8, 2016
2 parents 7518176 + eec9deb commit ebc4a0f
Show file tree
Hide file tree
Showing 20 changed files with 103 additions and 341 deletions.
1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
*.log
51 changes: 0 additions & 51 deletions .travis.yml

This file was deleted.

10 changes: 5 additions & 5 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -7,11 +7,11 @@
Contains the following base images:

* node versions:
- 6.7.0
- 6.7.0-ssh (with openssh installed)
- 6.7.0-vips (with libvips installed)
- 6.7.0-vips-ssh (ssh+vips)
- 6.7.0-ruby (with ruby 2.3.1 installed)
- 6.9.1
- 6.9.1-ssh (with openssh installed)
- 6.9.1-vips (with libvips installed)
- 6.9.1-vips-ssh (ssh+vips)
- 6.9.1-ruby (with ruby 2.3.1 installed)

## Currently disabled

Expand Down
56 changes: 56 additions & 0 deletions build.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,56 @@
#!/bin/bash

set -e

#set the DEBUG env variable to turn on debugging
[[ -n "$DEBUG" ]] && set -x

# global env vars
export \
PROJECT=node \
NAMESPACE=makeomatic \
PUSH_NAMESPACES=makeomatic \
BASE_NAME=makeomatic/node

BRANCH_NAME=${BRANCH_NAME:-$(git branch | grep ^*|cut -d" " -f2)}
echo "working in $BRANCH_NAME"
BRANCH_NAME=$(echo $BRANCH_NAME | sed -e "s/\//-/g")
echo "tagging as $BRANCH_NAME"

# install basic scripts
curl -sSL https://github.com/makeomatic/ci-scripts/raw/master/install.sh | sh -s
[ -d ~/official-images ] || git clone https://github.com/docker-library/official-images.git ~/official-images

# add scripts to PATH
export PATH=$PATH:~/ci-scripts

# cleanup logs
rm -rf ./*.log

# build base node images that are used further in the project
docker-build $BASE_NAME -f node/Dockerfile .
docker-build -v "onbuild" $BASE_NAME -f node/Dockerfile.onbuild .
docker-build -v "tester" $BASE_NAME -f node/Dockerfile.tester .
docker-build -v "tester-glibc" $BASE_NAME -f node/Dockerfile.tester-glibc .
# build node images with ruby
docker-build -v "ruby" $BASE_NAME -f node-ruby/Dockerfile .
# build node images with ssh embedded
docker-build -v "ssh" $BASE_NAME -f node-ssh/Dockerfile .
docker-build -v "ssh-onbuild" $BASE_NAME -f node-ssh/Dockerfile.onbuild .
# build node images with libvips
docker-build -v "vips" $BASE_NAME -f node-vips/Dockerfile .
docker-build -v "vips-onbuild" $BASE_NAME -f node-vips/Dockerfile.onbuild .
docker-build -v "vips-tester-glibc" $BASE_NAME -f node-vips/Dockerfile.tester-glibc .
# build node images with libvips & ssh
docker-build -v "vips-ssh" $BASE_NAME -f node-vips-ssh/Dockerfile .
docker-build -v "vips-ssh-onbuild" $BASE_NAME -f node-vips-ssh/Dockerfile.onbuild .

# List of newly created images
images=$(docker images $BASE_NAME | tr -s '[:space:]' | cut -f1,2 -d' ' | sed 's/ /:/')

# we actually need to
# Push to docker when DEPLOY is true
[ ${BRANCH_NAME} = master ] && for image in $images; do docker push $image; done

# report
docker images $BASE_NAME
1 change: 0 additions & 1 deletion libvips-apk/.dockerignore

This file was deleted.

41 changes: 0 additions & 41 deletions libvips-apk/APKBUILD

This file was deleted.

30 changes: 0 additions & 30 deletions libvips-apk/Dockerfile

This file was deleted.

36 changes: 0 additions & 36 deletions libvips-apk/etc/abuild.conf

This file was deleted.

8 changes: 4 additions & 4 deletions node-ruby/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
FROM alpine:3.4

LABEL vendor=makeomatic \
version_tags="[\"6\",\"6.7.0\"]"
version_tags="[\"6\",\"6.9.1\"]"

ENV NODE_VERSION=v6.7.0 \
ENV NODE_VERSION=v6.9.1 \
NPM_VERSION=3 \
NODE_HOME=/usr/local \
RUBY_MAJOR=2.3 \
Expand All @@ -27,7 +27,7 @@ RUN \
echo 'update: --no-document'; \
} >> /usr/local/etc/gemrc \
&& set -ex \
&& apk add --no-cache --update --virtual .builddeps \
&& apk add --no-cache --virtual .builddeps \
bison \
bzip2 \
bzip2-dev \
Expand Down Expand Up @@ -75,6 +75,7 @@ RUN \
./configure --disable-install-doc \
&& make -j"$(getconf _NPROCESSORS_ONLN)" \
&& make install \
&& gem update --system $RUBYGEMS_VERSION \
&& cd / \
&& curl -sSL https://nodejs.org/dist/${NODE_VERSION}/node-${NODE_VERSION}.tar.gz | tar -xz \
&& cd /node-${NODE_VERSION} \
Expand All @@ -96,7 +97,6 @@ RUN \
)" \
&& apk add --virtual .rundeps $runDeps \
&& apk del .builddeps \
&& gem update --system $RUBYGEMS_VERSION \
&& rm -rf /node-${NODE_VERSION} \
/usr/src/ruby \
/usr/share/man /tmp/* /root/.npm /root/.node-gyp \
Expand Down
51 changes: 4 additions & 47 deletions node-ssh/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,50 +1,7 @@
FROM alpine:3.4

LABEL vendor=makeomatic \
version_tags="[\"6\",\"6.7.0\"]"

ENV NODE_VERSION=v6.7.0 \
NPM_VERSION=3 \
NODE_HOME=/usr/local
FROM makeomatic/node:6.9.1

# add extra packages
RUN \
apk add --no-cache --update --virtual .node-buildDeps \
git \
curl \
make \
gcc \
g++ \
binutils-gold \
python \
linux-headers \
paxctl \
libgcc \
libstdc++ \
apk add --no-cache --virtual .flavorDeps \
openssh \
&& curl -sSL https://nodejs.org/dist/${NODE_VERSION}/node-${NODE_VERSION}.tar.gz | tar -xz \
&& cd /node-${NODE_VERSION} \
&& ./configure --prefix=${NODE_HOME} ${CONFIG_FLAGS} \
&& make -j$(grep -c ^processor /proc/cpuinfo 2>/dev/null || 1) \
&& make install \
&& paxctl -cm ${NODE_HOME}/bin/node \
&& cd / \
&& if [ -x ${NODE_HOME}/bin/npm ]; then \
npm install -g npm@${NPM_VERSION} && \
find ${NODE_HOME}/lib/node_modules/npm -name test -o -name .bin -type d | xargs rm -rf; \
fi \
&& runDeps="$( \
scanelf --needed --nobanner --recursive /usr/local \
| awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \
| sort -u \
| xargs -r apk info --installed \
| sort -u \
)" \
&& apk add --virtual .rundeps $runDeps \
&& apk add --virtual .flavorDeps openssh git \
&& apk del .node-buildDeps \
&& rm -rf /node-${NODE_VERSION} \
${NODE_HOME}/share/man /tmp/* /root/.npm /root/.node-gyp \
${NODE_HOME}/lib/node_modules/npm/man ${NODE_HOME}/lib/node_modules/npm/doc ${NODE_HOME}/lib/node_modules/npm/html \
&& adduser -S node

CMD [ "npm", "start" ]
git
2 changes: 1 addition & 1 deletion node-ssh/Dockerfile.onbuild
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
FROM makeomatic/node:6.7.0-ssh
FROM makeomatic/node:6.9.1-ssh

# copy stuff in
ONBUILD WORKDIR /src
Expand Down
55 changes: 4 additions & 51 deletions node-vips-ssh/Dockerfile
Original file line number Diff line number Diff line change
@@ -1,52 +1,5 @@
FROM alpine:3.4
FROM makeomatic/node:6.9.1-vips

LABEL vendor=makeomatic \
version_tags="[\"6\",\"6.7.0\"]"

ENV NODE_VERSION=v6.7.0 \
NPM_VERSION=3 \
NODE_HOME=/usr/local

RUN \
printf "-----BEGIN PUBLIC KEY-----\nMIIBIjANBgkqhkiG9w0BAQEFAAOCAQ8AMIIBCgKCAQEA29qkaf8HSeDwWO8MNipl\nPsiCdwETf9QK/k5ZoUyCF6xtBYg4BFcfAjdyzP5+uJmdIIfyWbrw8D7QCNVlSqTh\nzL4vm3X3ezLYdbm+QTr12aXLafJQI1FVvU+pRK3zsI0E2tjgLKdLBTLAe/aIzPbS\nLmsKPym/T3e2nNngyw+csvuLSQusgSrsiOt/6FZYFUMqTh2P6wfv+CHqyyqy3kK6\nQof/BWeX1aWisJYt/9nyXGJSyvi4KlxVrD6KIcw1mB4+UsN1VlK3YPBSHbA37y6D\nlhJd5rr47YqmQUyr+ooFQ0DGXVXJ/zDq8PiTq5dTvgwcMZAHt96W2gY0UFxt0waZ\nWwIDAQAB\n-----END PUBLIC KEY-----\n" > /etc/apk/keys/[email protected] \
&& apk add --no-cache --update --virtual .node-buildDeps \
git \
curl \
make \
gcc \
g++ \
binutils-gold \
python \
linux-headers \
paxctl \
libgcc \
libstdc++ \
openssh \
&& curl -sSL https://nodejs.org/dist/${NODE_VERSION}/node-${NODE_VERSION}.tar.gz | tar -xz \
&& cd /node-${NODE_VERSION} \
&& ./configure --prefix=${NODE_HOME} ${CONFIG_FLAGS} \
&& make -j$(grep -c ^processor /proc/cpuinfo 2>/dev/null || 1) \
&& make install \
&& paxctl -cm ${NODE_HOME}/bin/node \
&& cd / \
&& if [ -x ${NODE_HOME}/bin/npm ]; then \
npm install -g npm@${NPM_VERSION} && \
find ${NODE_HOME}/lib/node_modules/npm -name test -o -name .bin -type d | xargs rm -rf; \
fi \
&& runDeps="$( \
scanelf --needed --nobanner --recursive /usr/local \
| awk '{ gsub(/,/, "\nso:", $2); print "so:" $2 }' \
| sort -u \
| xargs -r apk info --installed \
| sort -u \
)" \
&& apk add --virtual .rundeps $runDeps \
&& apk add --virtual .flavorDeps openssh git \
&& apk del .node-buildDeps \
&& rm -rf /node-${NODE_VERSION} \
${NODE_HOME}/share/man /tmp/* /root/.npm /root/.node-gyp \
${NODE_HOME}/lib/node_modules/npm/man ${NODE_HOME}/lib/node_modules/npm/doc ${NODE_HOME}/lib/node_modules/npm/html \
&& adduser -S node \
&& apk add libvips --no-cache --update --repository http://cdn.matic.ninja/apk/community

CMD [ "npm", "start" ]
RUN apk add --no-cache --virtual .flavorDeps \
openssh \
git
Loading

0 comments on commit ebc4a0f

Please sign in to comment.