forked from chriswessels/meteor-tupperware
-
Notifications
You must be signed in to change notification settings - Fork 0
/
quickstart.sh
53 lines (41 loc) · 1.53 KB
/
quickstart.sh
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
#!/bin/bash
QUICKSTART_VERSION="0.1.2"
PWD=`pwd`
# Defaults
maintainer_string="# MAINTAINER Darth Vader <[email protected]>"
echo "\n>> meteor-tupperware quickstart script $QUICKSTART_VERSION\n"
if [[ -f $PWD/Dockerfile || -f $PWD/.dockerignore ]]; then
echo "! A Dockerfile or .dockerignore file already exists in this directory, $PWD. Please check, remove them and rerun this tool."
exit 1
fi
echo "] Docker Image Maintainer Information"
echo "? Please enter your name: "
read user_name
if [[ ! -z "$user_name" ]]; then
maintainer="$user_name"
echo "? Thanks, $user_name. Now your e-mail address:"
read user_email
if [[ ! -z "$user_email" ]]; then
maintainer="$maintainer <$user_email>"
fi
maintainer_string="MAINTAINER $maintainer"
echo "> Got it. The image maintainer will be set to: $maintainer"
fi
cat <<EOF > ./Dockerfile
# Generated by meteor-tupperware quickstart script $QUICKSTART_VERSION
# https://github.com/chriswessels/meteor-tupperware
# Inherit from chriswessels/meteor-tupperware image
FROM quay.io/chriswessels/meteor-tupperware
# The maintainer of your app image
$maintainer_string
# (optional) Bake runtime options into your image
# ENV MONGO_URL="mongodb://url" MONGO_OPLOG_URL="mongodb://oplog_url" ROOT_URL="http://yourapp.com"
EOF
cat <<EOF > ./.dockerignore
.meteor/local
packages/*/.build*
packages/*/.npm*
EOF
echo "\n] Success"
echo "> Wrote Dockerfile and .dockerignore to $PWD. Assuming you have Docker running, you can now build your app image with:"
echo "$ docker build -t yourname/app ."