Skip to content

Commit

Permalink
Meteor 1.1 support.
Browse files Browse the repository at this point in the history
Beginning to deprecate the semver approach of applying multiple version tags (i.e. 1.0.5, 1.0, and 1) to a release - Meteor does not actually follow semver.
  • Loading branch information
DanielDent committed Apr 1, 2015
1 parent 327b9f9 commit 04ddfa8
Show file tree
Hide file tree
Showing 6 changed files with 108 additions and 2 deletions.
1 change: 1 addition & 0 deletions 1.0.5/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@ ENV METEOR_VERSION 1.0.5
ENV METEOR_INSTALLER_SHA256 4020ef4d3bc257cd570b5b2d49e3490699c52d0fd98453e29b7addfbdfba9c80
ENV METEOR_LINUX_X86_32_SHA256 7dedd029f41082f0b009a9cf96ab729e2252553e7d19a9f96d11207ca049f464
ENV METEOR_LINUX_X86_64_SHA256 77e011f6a8099ec3dc4527b635f3197896d698877da75e5365457e6a15b8979b
ENV TARBALL_URL_OVERRIDE https://github.com/DanielDent/docker-meteor/releases/download/v${RELEASE}/meteor-bootstrap-${PLATFORM}-${RELEASE}.tar.gz

# 1. Download & verify the meteor installer.
# 2. Patch it to validate the meteor tarball's checksums.
Expand Down
12 changes: 12 additions & 0 deletions 1.1-onbuild/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,12 @@
FROM danieldent/meteor:1.1
MAINTAINER Daniel Dent (https://www.danieldent.com/)
ONBUILD COPY . /opt/src
ONBUILD WORKDIR /opt/src
ONBUILD RUN meteor build .. --directory \
&& cd ../bundle/programs/server \
&& npm install \
&& rm -rf /opt/src
ONBUILD WORKDIR /opt/bundle
ONBUILD USER nobody
ONBUILD ENV PORT 3000
CMD ["/usr/local/bin/node", "main.js"]
26 changes: 26 additions & 0 deletions 1.1/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
FROM node:0.10
MAINTAINER Daniel Dent (https://www.danieldent.com/)

ENV METEOR_VERSION 1.1
ENV METEOR_INSTALLER_SHA256 4020ef4d3bc257cd570b5b2d49e3490699c52d0fd98453e29b7addfbdfba9c80
ENV METEOR_LINUX_X86_32_SHA256 a4eb24501ceeb73739125f45cb72fda57f2c2f3462a7d2bbf6424ab231e89be7
ENV METEOR_LINUX_X86_64_SHA256 93a95576ae1b41bc7d9808dd558e7e397d9ee9cab3b96e35566fc3c291062a84

# 1. Download & verify the meteor installer.
# 2. Patch it to validate the meteor tarball's checksums.
# 3. Install meteor

COPY meteor-installer.patch /tmp/meteor/meteor-installer.patch
COPY vboxsf-shim.sh /usr/local/bin/vboxsf-shim
RUN curl -SL https://install.meteor.com/ -o /tmp/meteor/inst \
&& sed -e "s/^RELEASE=.*/RELEASE=\"\$METEOR_VERSION\"/" /tmp/meteor/inst > /tmp/meteor/inst-canonical \
&& echo $METEOR_INSTALLER_SHA256 /tmp/meteor/inst-canonical | sha256sum -c \
&& patch /tmp/meteor/inst /tmp/meteor/meteor-installer.patch \
&& chmod +x /tmp/meteor/inst \
&& /tmp/meteor/inst \
&& rm -rf /tmp/meteor

VOLUME /app
WORKDIR /app
EXPOSE 3000
CMD [ "meteor" ]
55 changes: 55 additions & 0 deletions 1.1/meteor-installer.patch
Original file line number Diff line number Diff line change
@@ -0,0 +1,55 @@
--- meteor-installer 2014-12-10 15:22:12.232084632 -0800
+++ meteor-installer.new 2014-12-10 15:27:20.532084632 -0800
@@ -31,6 +31,11 @@
## know what shell the user has. Debian uses 'dash' for 'sh', for
## example.

+# If METEOR_VERSION is set, we want to install that instead.
+if [ "${METEOR_VERSION}" != "latest" ] ; then
+ RELEASE="${METEOR_VERSION:-$RELEASE}"
+fi
+
PREFIX="/usr/local"

set -e
@@ -41,7 +46,7 @@


UNAME=$(uname)
-if [ "$UNAME" != "Linux" -a "$UNAME" != "Darwin" ] ; then
+if [ "$UNAME" != "Linux" ] ; then
echo "Sorry, this OS is not supported yet."
exit 1
fi
@@ -73,8 +78,10 @@
LINUX_ARCH=$(uname -m)
if [ "${LINUX_ARCH}" = "i686" ] ; then
PLATFORM="os.linux.x86_32"
+ TARBALL_CHECKSUM="${METEOR_LINUX_X86_32_SHA256:-}"
elif [ "${LINUX_ARCH}" = "x86_64" ] ; then
PLATFORM="os.linux.x86_64"
+ TARBALL_CHECKSUM="${METEOR_LINUX_X86_64_SHA256:-}"
else
echo "Unusable architecture: ${LINUX_ARCH}"
echo "Meteor only supports i686 and x86_64 for now."
@@ -118,7 +125,19 @@
rm -rf "$INSTALL_TMPDIR"
mkdir "$INSTALL_TMPDIR"
echo "Downloading Meteor distribution"
-curl --progress-bar --fail "$TARBALL_URL" | tar -xzf - -C "$INSTALL_TMPDIR" -o
+INSTALLER_TARBALL=$(mktemp)
+eval curl -L --progress-bar --fail "${TARBALL_URL_OVERRIDE:-$TARBALL_URL}" > $INSTALLER_TARBALL
+# If we got passed an explicit version, then we also expect
+# to be passed that version's checksums.
+if [ "${METEOR_VERSION:-latest}" != "latest" ]; then
+ if ! echo "$TARBALL_CHECKSUM $INSTALLER_TARBALL" | sha256sum -c; then
+ rm -rf "${INSTALLER_TARBALL}"
+ echo "Installer tarball checksum failed."
+ exit 1
+ fi
+fi
+tar -xzf $INSTALLER_TARBALL -C "$INSTALL_TMPDIR" -o
+rm -rf "${INSTALLER_TARBALL}"
# bomb out if it didn't work, eg no net
test -x "${INSTALL_TMPDIR}/.meteor/meteor"
mv "${INSTALL_TMPDIR}/.meteor" "$HOME"
10 changes: 10 additions & 0 deletions 1.1/vboxsf-shim.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
#!/bin/sh

# If there's a .meteor/local directory we can mount on top of, we create a directory in /tmp for a bind mount.
# This allows MongoDB to acquire the lock it needs and meteor's development server to be happy with filesystem sync.

if ! [ -d /tmp/meteor-local ]; then
mkdir /tmp/meteor-local && mount -o bind /tmp/meteor-local .meteor/local || rmdir /tmp/meteor-local
fi

exec "$@"
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,10 @@

- [`latest` (*latest/Dockerfile*)](https://github.com/DanielDent/docker-meteor/blob/master/latest/Dockerfile)
- [`onbuild` (*onbuild/Dockerfile*)](https://github.com/DanielDent/docker-meteor/blob/master/onbuild/Dockerfile)
- [`1.0.5`, `1.0`, `1` (*1.0.5/Dockerfile*)](https://github.com/DanielDent/docker-meteor/blob/master/1.0.5/Dockerfile)
- [`1.0.5-onbuild`, `1.0-onbuild`, `1-onbuild` (*1.0.5-onbuild/Dockerfile*)](https://github.com/DanielDent/docker-meteor/blob/master/1.0.5-onbuild/Dockerfile)
- [`1.1`, `1` (*1.1/Dockerfile*)](https://github.com/DanielDent/docker-meteor/blob/master/1.1/Dockerfile)
- [`1.1-onbuild`, `1-onbuild` (*1.1-onbuild/Dockerfile*)](https://github.com/DanielDent/docker-meteor/blob/master/1.1-onbuild/Dockerfile)
- [`1.0.5`, `1.0`, (*1.0.5/Dockerfile*)](https://github.com/DanielDent/docker-meteor/blob/master/1.0.5/Dockerfile)
- [`1.0.5-onbuild`, `1.0-onbuild`, (*1.0.5-onbuild/Dockerfile*)](https://github.com/DanielDent/docker-meteor/blob/master/1.0.5-onbuild/Dockerfile)
- [`1.0.4.2`, (*1.0.4.2/Dockerfile*)](https://github.com/DanielDent/docker-meteor/blob/master/1.0.4.2/Dockerfile)
- [`1.0.4.2-onbuild`, (*1.0.4.2-onbuild/Dockerfile*)](https://github.com/DanielDent/docker-meteor/blob/master/1.0.4.2-onbuild/Dockerfile)
- [`1.0.4.1`, (*1.0.4.1/Dockerfile*)](https://github.com/DanielDent/docker-meteor/blob/master/1.0.4.1/Dockerfile)
Expand Down

0 comments on commit 04ddfa8

Please sign in to comment.