From cbe14fe71ae59498ed01a1455367a186366ce305 Mon Sep 17 00:00:00 2001 From: Sebastian Lutter Date: Thu, 25 Oct 2018 17:01:18 +0200 Subject: [PATCH 1/9] Support meteor 1.8, update mongo to version 4.0.2 and nodejs to 8.11.4. Switched from debian jessie to stretch. Install stretch version of gosu 1.10 instead of building from source. --- Dockerfile | 10 +++++----- scripts/install-deps.sh | 23 +---------------------- 2 files changed, 6 insertions(+), 27 deletions(-) diff --git a/Dockerfile b/Dockerfile index 3e7f1c4..bebc500 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,5 +1,5 @@ -FROM debian:jessie -MAINTAINER Jeremy Shimko +FROM debian:stretch +MAINTAINER Jeremy Shimko , Sebastian Lutter RUN groupadd -r node && useradd -m -g node node @@ -7,8 +7,8 @@ RUN groupadd -r node && useradd -m -g node node ENV GOSU_VERSION 1.10 # MongoDB -ENV MONGO_VERSION 3.4.10 -ENV MONGO_MAJOR 3.4 +ENV MONGO_VERSION 4.0.2 +ENV MONGO_MAJOR 4.0 ENV MONGO_PACKAGE mongodb-org # PhantomJS @@ -28,7 +28,7 @@ ONBUILD ARG APT_GET_INSTALL ONBUILD ENV APT_GET_INSTALL $APT_GET_INSTALL ONBUILD ARG NODE_VERSION -ONBUILD ENV NODE_VERSION ${NODE_VERSION:-8.9.0} +ONBUILD ENV NODE_VERSION ${NODE_VERSION:-8.11.4} ONBUILD ARG NPM_TOKEN ONBUILD ENV NPM_TOKEN $NPM_TOKEN diff --git a/scripts/install-deps.sh b/scripts/install-deps.sh index ef10605..2bbe068 100755 --- a/scripts/install-deps.sh +++ b/scripts/install-deps.sh @@ -21,25 +21,4 @@ if [ -f $APP_SOURCE_DIR/launchpad.conf ]; then fi fi -apt-get install -y --no-install-recommends curl bzip2 bsdtar build-essential python git wget - - -# install gosu - -dpkgArch="$(dpkg --print-architecture | awk -F- '{ print $NF }')" - -wget -O /usr/local/bin/gosu "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch" -wget -O /usr/local/bin/gosu.asc "https://github.com/tianon/gosu/releases/download/$GOSU_VERSION/gosu-$dpkgArch.asc" - -export GNUPGHOME="$(mktemp -d)" - -gpg --keyserver hkp://p80.pool.sks-keyservers.net:80 --recv-keys B42F6819007F00F88E364FD4036A9C25BF357DD4 -gpg --batch --verify /usr/local/bin/gosu.asc /usr/local/bin/gosu - -rm -r "$GNUPGHOME" /usr/local/bin/gosu.asc - -chmod +x /usr/local/bin/gosu - -gosu nobody true - -apt-get purge -y --auto-remove wget +apt-get install -y --no-install-recommends curl bzip2 bsdtar build-essential python git gnupg gosu From 65fd7dfc0253b7a79f781f1fcd07285233cf23f3 Mon Sep 17 00:00:00 2001 From: Sebastian Lutter Date: Thu, 25 Oct 2018 17:02:24 +0200 Subject: [PATCH 2/9] Removed unused gnupg from apt-get install --- scripts/install-deps.sh | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/scripts/install-deps.sh b/scripts/install-deps.sh index 2bbe068..abd0b6b 100755 --- a/scripts/install-deps.sh +++ b/scripts/install-deps.sh @@ -21,4 +21,4 @@ if [ -f $APP_SOURCE_DIR/launchpad.conf ]; then fi fi -apt-get install -y --no-install-recommends curl bzip2 bsdtar build-essential python git gnupg gosu +apt-get install -y --no-install-recommends curl bzip2 bsdtar build-essential python git gosu From 4c6dff9d5715c32a5093339d81e3ba9778069180 Mon Sep 17 00:00:00 2001 From: Sebastian Lutter Date: Thu, 25 Oct 2018 18:34:38 +0200 Subject: [PATCH 3/9] Added meteor 1.8 support notice --- HISTORY.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/HISTORY.md b/HISTORY.md index ffc66b7..1f7add7 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,3 +1,11 @@ + +## current master + +- Updates for Meteor 1.8 support +- Node 8.11.4 +- Mongo 4.0.2 + + ## v2.3.0 - Updates for Meteor 1.6 support From 025329d5c222756cc925204f27bd2b3ffb8855b1 Mon Sep 17 00:00:00 2001 From: Sebastian Lutter Date: Thu, 25 Oct 2018 18:36:41 +0200 Subject: [PATCH 4/9] Added meteor 1.8 environment --- dev.dockerfile | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/dev.dockerfile b/dev.dockerfile index 8911919..8c4edce 100644 --- a/dev.dockerfile +++ b/dev.dockerfile @@ -6,11 +6,11 @@ RUN groupadd -r node && useradd -m -g node node ENV DEV_BUILD true # Gosu -ENV GOSU_VERSION 1.10 +#ENV GOSU_VERSION 1.10 # MongoDB -ENV MONGO_VERSION 3.4.10 -ENV MONGO_MAJOR 3.4 +ENV MONGO_VERSION 4.0.2 +ENV MONGO_MAJOR 4.0 ENV MONGO_PACKAGE mongodb-org # PhantomJS @@ -34,7 +34,7 @@ ONBUILD ARG APT_GET_INSTALL ONBUILD ENV APT_GET_INSTALL $APT_GET_INSTALL ONBUILD ARG NODE_VERSION -ONBUILD ENV NODE_VERSION ${NODE_VERSION:-8.9.0} +ONBUILD ENV NODE_VERSION ${NODE_VERSION:-8.11.4} ONBUILD ARG INSTALL_MONGO ONBUILD ENV INSTALL_MONGO ${INSTALL_MONGO:-true} From 0367e5dbe513ace4294f6fd1cc1a978f605f8728 Mon Sep 17 00:00:00 2001 From: Sebastian Lutter Date: Fri, 26 Oct 2018 10:01:37 +0200 Subject: [PATCH 5/9] Added modification hint --- README.md | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 7f9eb45..bbd1969 100644 --- a/README.md +++ b/README.md @@ -1,6 +1,7 @@ -[![Circle CI](https://circleci.com/gh/jshimko/meteor-launchpad/tree/master.svg?style=svg)](https://circleci.com/gh/jshimko/meteor-launchpad/tree/master) # Meteor Launchpad - Base Docker Image for Meteor Apps +This version is just a fork of *jshimko/meteor-launchpad* with some updates to support meteor 1.8 + ### Build Add the following to a `Dockerfile` in the root of your app: From 2de5540f3abe81956a6588883473923f9e8b4b84 Mon Sep 17 00:00:00 2001 From: Sebastian Lutter Date: Fri, 26 Oct 2018 10:16:20 +0200 Subject: [PATCH 6/9] Minor changes. Changed documentation commands from jshimko to pixolution. Removed circleci code. --- .circleci/build.sh | 9 --------- .circleci/config.yml | 23 ----------------------- .circleci/deploy.sh | 41 ----------------------------------------- .dockerignore | 1 - HISTORY.md | 3 +-- README.md | 6 +++--- build.sh | 2 +- deploy.sh | 6 +++--- dev.dockerfile | 3 --- 9 files changed, 8 insertions(+), 86 deletions(-) delete mode 100755 .circleci/build.sh delete mode 100644 .circleci/config.yml delete mode 100755 .circleci/deploy.sh diff --git a/.circleci/build.sh b/.circleci/build.sh deleted file mode 100755 index 8123945..0000000 --- a/.circleci/build.sh +++ /dev/null @@ -1,9 +0,0 @@ -#!/bin/bash - -set -e - -IMAGE_NAME=${DOCKER_IMAGE_NAME:-"jshimko/meteor-launchpad"} - -# build the latest -docker build -f dev.dockerfile -t $IMAGE_NAME:devbuild . -docker build -t $IMAGE_NAME:latest . diff --git a/.circleci/config.yml b/.circleci/config.yml deleted file mode 100644 index ec24c79..0000000 --- a/.circleci/config.yml +++ /dev/null @@ -1,23 +0,0 @@ -version: 2 - -jobs: - build: - working_directory: /home/launchpad - - docker: - - image: docker:latest - - steps: - - setup_remote_docker - - checkout - - # install OS dependencies - - run: apk update && apk upgrade && apk add --no-cache bash git openssh - - # run build test - - run: .circleci/build.sh - - # deploy the build (if on a deployment branch) - - deploy: - name: Docker Image Deploment - command: .circleci/deploy.sh diff --git a/.circleci/deploy.sh b/.circleci/deploy.sh deleted file mode 100755 index 4f09695..0000000 --- a/.circleci/deploy.sh +++ /dev/null @@ -1,41 +0,0 @@ -#!/bin/bash - -## Required environment variables in your CircleCI dashboard -# (used to push to Docker Hub) -# -# $DOCKER_USER - Docker Hub username -# $DOCKER_PASS - Docker Hub password -# $DOCKER_EMAIL - Docker Hub email - -## Optional environment variables -# -# $DOCKER_IMAGE_NAME - use to push the build to your own Docker Hub account (Default: jshimko/meteor-launchpad) - -# Master branch versioned deployment (only runs when a version number git tag exists - syntax: "v1.2.3") -if [[ "$CIRCLE_BRANCH" == "master" ]]; then - # check if we're on a version tagged commit - VERSION=$(git describe --tags | grep "^v[0-9]\+\.[0-9]\+\.[0-9]\+$") - - if [[ "$VERSION" ]]; then - set -e - - IMAGE_NAME=${DOCKER_IMAGE_NAME:-"jshimko/meteor-launchpad"} - - # create a versioned tags - docker tag $IMAGE_NAME:devbuild $IMAGE_NAME:$VERSION-devbuild - docker tag $IMAGE_NAME:latest $IMAGE_NAME:$VERSION - - # login to Docker Hub - docker login -u $DOCKER_USER -p $DOCKER_PASS - - # push the builds - docker push $IMAGE_NAME:$VERSION-devbuild - docker push $IMAGE_NAME:devbuild - docker push $IMAGE_NAME:$VERSION - docker push $IMAGE_NAME:latest - else - echo "On a deployment branch, but no version tag was found. Skipping image deployment." - fi -else - echo "Not in a deployment branch. Skipping image deployment." -fi diff --git a/.dockerignore b/.dockerignore index d6e4dc7..1c0fe9d 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,4 +1,3 @@ -.circleci .git build.sh deploy.sh diff --git a/HISTORY.md b/HISTORY.md index 1f7add7..27d253b 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,11 +1,10 @@ -## current master +## v2.3.1 - Updates for Meteor 1.8 support - Node 8.11.4 - Mongo 4.0.2 - ## v2.3.0 - Updates for Meteor 1.6 support diff --git a/README.md b/README.md index bbd1969..e0b7a37 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ This version is just a fork of *jshimko/meteor-launchpad* with some updates to s Add the following to a `Dockerfile` in the root of your app: ```Dockerfile -FROM jshimko/meteor-launchpad:latest +FROM pixolution/meteor-launchpad:v.2.3.1 ``` Then you can build the image with: @@ -110,7 +110,7 @@ docker build --build-arg NPM_TOKEN="" -t myorg/myapp:latest . You can optionally avoid downloading Meteor every time when building regularly in development. Add the following to your Dockerfile instead... ```Dockerfile -FROM jshimko/meteor-launchpad:devbuild +FROM pixolution/meteor-launchpad:devbuild ``` This isn't recommended for your final production build because it creates a much larger image, but it's a bit of a time saver when you're building often in development. The first build you run will download/install Meteor and then every subsequent build will be able to skip that step and just build the app. @@ -165,7 +165,7 @@ If you'd like to create a custom build for some reason, you can use the `build.s First, make any changes you want, then to create your custom build: ```sh -# builds as jshimko/meteor-launchpad:latest +# builds as pixolution/meteor-launchpad:latest ./build.sh ``` diff --git a/build.sh b/build.sh index 52b66b0..3cb8a03 100755 --- a/build.sh +++ b/build.sh @@ -2,7 +2,7 @@ set -e -IMAGE_NAME=${1:-"jshimko/meteor-launchpad"} +IMAGE_NAME=${1:-"pixolution/meteor-launchpad"} printf "\n[-] Building $IMAGE_NAME...\n\n" diff --git a/deploy.sh b/deploy.sh index de9756f..c938e1b 100755 --- a/deploy.sh +++ b/deploy.sh @@ -3,10 +3,10 @@ set -e # Example usage: -# deploy.sh jshimko/meteor-launchpad v1.0.0 +# deploy.sh pixolution/meteor-launchpad v2.3.1 -IMAGE_NAME=$1 # jshimko/meteor-launchpad -VERSION=$2 # v1.0.0 +IMAGE_NAME=$1 # pixolution/meteor-launchpad +VERSION=$2 # v2.3.1 # create versioned tags docker tag $IMAGE_NAME:devbuild $IMAGE_NAME:$VERSION-devbuild diff --git a/dev.dockerfile b/dev.dockerfile index 8c4edce..05d03af 100644 --- a/dev.dockerfile +++ b/dev.dockerfile @@ -5,9 +5,6 @@ RUN groupadd -r node && useradd -m -g node node ENV DEV_BUILD true -# Gosu -#ENV GOSU_VERSION 1.10 - # MongoDB ENV MONGO_VERSION 4.0.2 ENV MONGO_MAJOR 4.0 From 6869e82383dc6a8a9d7269213171f2ced553a071 Mon Sep 17 00:00:00 2001 From: Sebastian Lutter Date: Fri, 26 Oct 2018 10:30:47 +0200 Subject: [PATCH 7/9] Fixed typo --- README.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/README.md b/README.md index e0b7a37..05c35ff 100644 --- a/README.md +++ b/README.md @@ -7,7 +7,7 @@ This version is just a fork of *jshimko/meteor-launchpad* with some updates to s Add the following to a `Dockerfile` in the root of your app: ```Dockerfile -FROM pixolution/meteor-launchpad:v.2.3.1 +FROM pixolution/meteor-launchpad:v2.3.1 ``` Then you can build the image with: From e7e5fc69c8abcbb060de49e581846522230adb07 Mon Sep 17 00:00:00 2001 From: Sebastian Lutter Date: Mon, 29 Oct 2018 11:48:00 +0100 Subject: [PATCH 8/9] Reverted unused commits for easier merge --- .circleci/build.sh | 9 +++++++++ .circleci/config.yml | 23 +++++++++++++++++++++++ .circleci/deploy.sh | 41 +++++++++++++++++++++++++++++++++++++++++ .dockerignore | 1 + HISTORY.md | 3 ++- README.md | 9 ++++----- build.sh | 2 +- deploy.sh | 6 +++--- dev.dockerfile | 3 +++ 9 files changed, 87 insertions(+), 10 deletions(-) create mode 100755 .circleci/build.sh create mode 100644 .circleci/config.yml create mode 100755 .circleci/deploy.sh diff --git a/.circleci/build.sh b/.circleci/build.sh new file mode 100755 index 0000000..8123945 --- /dev/null +++ b/.circleci/build.sh @@ -0,0 +1,9 @@ +#!/bin/bash + +set -e + +IMAGE_NAME=${DOCKER_IMAGE_NAME:-"jshimko/meteor-launchpad"} + +# build the latest +docker build -f dev.dockerfile -t $IMAGE_NAME:devbuild . +docker build -t $IMAGE_NAME:latest . diff --git a/.circleci/config.yml b/.circleci/config.yml new file mode 100644 index 0000000..ec24c79 --- /dev/null +++ b/.circleci/config.yml @@ -0,0 +1,23 @@ +version: 2 + +jobs: + build: + working_directory: /home/launchpad + + docker: + - image: docker:latest + + steps: + - setup_remote_docker + - checkout + + # install OS dependencies + - run: apk update && apk upgrade && apk add --no-cache bash git openssh + + # run build test + - run: .circleci/build.sh + + # deploy the build (if on a deployment branch) + - deploy: + name: Docker Image Deploment + command: .circleci/deploy.sh diff --git a/.circleci/deploy.sh b/.circleci/deploy.sh new file mode 100755 index 0000000..4f09695 --- /dev/null +++ b/.circleci/deploy.sh @@ -0,0 +1,41 @@ +#!/bin/bash + +## Required environment variables in your CircleCI dashboard +# (used to push to Docker Hub) +# +# $DOCKER_USER - Docker Hub username +# $DOCKER_PASS - Docker Hub password +# $DOCKER_EMAIL - Docker Hub email + +## Optional environment variables +# +# $DOCKER_IMAGE_NAME - use to push the build to your own Docker Hub account (Default: jshimko/meteor-launchpad) + +# Master branch versioned deployment (only runs when a version number git tag exists - syntax: "v1.2.3") +if [[ "$CIRCLE_BRANCH" == "master" ]]; then + # check if we're on a version tagged commit + VERSION=$(git describe --tags | grep "^v[0-9]\+\.[0-9]\+\.[0-9]\+$") + + if [[ "$VERSION" ]]; then + set -e + + IMAGE_NAME=${DOCKER_IMAGE_NAME:-"jshimko/meteor-launchpad"} + + # create a versioned tags + docker tag $IMAGE_NAME:devbuild $IMAGE_NAME:$VERSION-devbuild + docker tag $IMAGE_NAME:latest $IMAGE_NAME:$VERSION + + # login to Docker Hub + docker login -u $DOCKER_USER -p $DOCKER_PASS + + # push the builds + docker push $IMAGE_NAME:$VERSION-devbuild + docker push $IMAGE_NAME:devbuild + docker push $IMAGE_NAME:$VERSION + docker push $IMAGE_NAME:latest + else + echo "On a deployment branch, but no version tag was found. Skipping image deployment." + fi +else + echo "Not in a deployment branch. Skipping image deployment." +fi diff --git a/.dockerignore b/.dockerignore index 1c0fe9d..d6e4dc7 100644 --- a/.dockerignore +++ b/.dockerignore @@ -1,3 +1,4 @@ +.circleci .git build.sh deploy.sh diff --git a/HISTORY.md b/HISTORY.md index 27d253b..1f7add7 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,10 +1,11 @@ -## v2.3.1 +## current master - Updates for Meteor 1.8 support - Node 8.11.4 - Mongo 4.0.2 + ## v2.3.0 - Updates for Meteor 1.6 support diff --git a/README.md b/README.md index 05c35ff..7f9eb45 100644 --- a/README.md +++ b/README.md @@ -1,13 +1,12 @@ +[![Circle CI](https://circleci.com/gh/jshimko/meteor-launchpad/tree/master.svg?style=svg)](https://circleci.com/gh/jshimko/meteor-launchpad/tree/master) # Meteor Launchpad - Base Docker Image for Meteor Apps -This version is just a fork of *jshimko/meteor-launchpad* with some updates to support meteor 1.8 - ### Build Add the following to a `Dockerfile` in the root of your app: ```Dockerfile -FROM pixolution/meteor-launchpad:v2.3.1 +FROM jshimko/meteor-launchpad:latest ``` Then you can build the image with: @@ -110,7 +109,7 @@ docker build --build-arg NPM_TOKEN="" -t myorg/myapp:latest . You can optionally avoid downloading Meteor every time when building regularly in development. Add the following to your Dockerfile instead... ```Dockerfile -FROM pixolution/meteor-launchpad:devbuild +FROM jshimko/meteor-launchpad:devbuild ``` This isn't recommended for your final production build because it creates a much larger image, but it's a bit of a time saver when you're building often in development. The first build you run will download/install Meteor and then every subsequent build will be able to skip that step and just build the app. @@ -165,7 +164,7 @@ If you'd like to create a custom build for some reason, you can use the `build.s First, make any changes you want, then to create your custom build: ```sh -# builds as pixolution/meteor-launchpad:latest +# builds as jshimko/meteor-launchpad:latest ./build.sh ``` diff --git a/build.sh b/build.sh index 3cb8a03..52b66b0 100755 --- a/build.sh +++ b/build.sh @@ -2,7 +2,7 @@ set -e -IMAGE_NAME=${1:-"pixolution/meteor-launchpad"} +IMAGE_NAME=${1:-"jshimko/meteor-launchpad"} printf "\n[-] Building $IMAGE_NAME...\n\n" diff --git a/deploy.sh b/deploy.sh index c938e1b..de9756f 100755 --- a/deploy.sh +++ b/deploy.sh @@ -3,10 +3,10 @@ set -e # Example usage: -# deploy.sh pixolution/meteor-launchpad v2.3.1 +# deploy.sh jshimko/meteor-launchpad v1.0.0 -IMAGE_NAME=$1 # pixolution/meteor-launchpad -VERSION=$2 # v2.3.1 +IMAGE_NAME=$1 # jshimko/meteor-launchpad +VERSION=$2 # v1.0.0 # create versioned tags docker tag $IMAGE_NAME:devbuild $IMAGE_NAME:$VERSION-devbuild diff --git a/dev.dockerfile b/dev.dockerfile index 05d03af..8c4edce 100644 --- a/dev.dockerfile +++ b/dev.dockerfile @@ -5,6 +5,9 @@ RUN groupadd -r node && useradd -m -g node node ENV DEV_BUILD true +# Gosu +#ENV GOSU_VERSION 1.10 + # MongoDB ENV MONGO_VERSION 4.0.2 ENV MONGO_MAJOR 4.0 From 75cfd4ec47fdca6b380e090128a0ea1a2f5bfab8 Mon Sep 17 00:00:00 2001 From: Tobias Assmann Date: Mon, 17 Dec 2018 12:18:43 +0100 Subject: [PATCH 9/9] add apt-transport-https to dockerfile --- Dockerfile | 2 +- HISTORY.md | 7 +++++-- 2 files changed, 6 insertions(+), 3 deletions(-) diff --git a/Dockerfile b/Dockerfile index bebc500..41145f4 100644 --- a/Dockerfile +++ b/Dockerfile @@ -47,7 +47,7 @@ ONBUILD ARG TOOL_NODE_FLAGS ONBUILD ENV TOOL_NODE_FLAGS $TOOL_NODE_FLAGS # optionally custom apt dependencies at app build time -ONBUILD RUN if [ "$APT_GET_INSTALL" ]; then apt-get update && apt-get install -y $APT_GET_INSTALL; fi +ONBUILD RUN if [ "$APT_GET_INSTALL" ]; then apt-get update && apt-get install -y apt-transport-https && apt-get install -y $APT_GET_INSTALL; fi # copy the app to the container ONBUILD COPY . $APP_SOURCE_DIR diff --git a/HISTORY.md b/HISTORY.md index 1f7add7..36f31cb 100644 --- a/HISTORY.md +++ b/HISTORY.md @@ -1,11 +1,14 @@ -## current master +## v2.3.2 + +- ensure apt-get working with https mirrors via apt-transport-https + +## v2.3.1 - Updates for Meteor 1.8 support - Node 8.11.4 - Mongo 4.0.2 - ## v2.3.0 - Updates for Meteor 1.6 support