summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorBryan Hong <bryan@turbojets.net>2017-05-23 05:26:27 +0000
committerBryan Hong <bryan@turbojets.net>2017-05-23 05:26:27 +0000
commitf2e3ac91dd04b3025574ad5b4ab7f7318d0029d1 (patch)
tree2f73eda6dac4e055a13d05825d11c1bc6387e411
parent58f1859003a0d9151307eaaa40d14834e01144d4 (diff)
clean things up to make it easier to switch to a different release
swiching to xenial should be as easy as modifying the dockerfile and updating the update_mirror.sh script
-rw-r--r--Dockerfile8
-rw-r--r--README.md4
-rwxr-xr-xassets/startup.sh2
-rwxr-xr-xshell.sh4
-rw-r--r--vars2
5 files changed, 13 insertions, 7 deletions
diff --git a/Dockerfile b/Dockerfile
index ecdfd4d..cba071e 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -12,19 +12,21 @@
12# See the License for the specific language governing permissions and 12# See the License for the specific language governing permissions and
13# limitations under the License. 13# limitations under the License.
14 14
15FROM ubuntu:14.04 15FROM ubuntu:trusty
16 16
17MAINTAINER bryan@turbojets.net 17MAINTAINER bryan@turbojets.net
18 18
19ENV DEBIAN_FRONTEND noninteractive 19ENV DEBIAN_FRONTEND noninteractive
20ENV DIST=ubuntu
21ENV RELEASE=trusty
20 22
21# Add Aptly repository 23# Add Aptly repository
22RUN echo "deb http://repo.aptly.info/ squeeze main" > /etc/apt/sources.list.d/aptly.list 24RUN echo "deb http://repo.aptly.info/ squeeze main" > /etc/apt/sources.list.d/aptly.list
23RUN apt-key adv --keyserver keys.gnupg.net --recv-keys 9E3E53F19C7DE460 25RUN apt-key adv --keyserver keys.gnupg.net --recv-keys 9E3E53F19C7DE460
24 26
25# Add Nginx repository 27# Add Nginx repository
26RUN echo "deb http://nginx.org/packages/ubuntu/ trusty nginx" > /etc/apt/sources.list.d/nginx.list 28RUN echo "deb http://nginx.org/packages/$DIST/ $RELEASE nginx" > /etc/apt/sources.list.d/nginx.list
27RUN echo "deb-src http://nginx.org/packages/ubuntu/ trusty nginx" >> /etc/apt/sources.list.d/nginx.list 29RUN echo "deb-src http://nginx.org/packages/$DIST/ $RELEASE nginx" >> /etc/apt/sources.list.d/nginx.list
28RUN apt-key adv --keyserver hkp://pgp.mit.edu:80 --recv-keys 573BFD6B3D8FBC641079A6ABABF5BD827BD9BF62 30RUN apt-key adv --keyserver hkp://pgp.mit.edu:80 --recv-keys 573BFD6B3D8FBC641079A6ABABF5BD827BD9BF62
29 31
30# Update APT repository and install packages 32# Update APT repository and install packages
diff --git a/README.md b/README.md
index 9127434..5c32218 100644
--- a/README.md
+++ b/README.md
@@ -86,8 +86,8 @@ Point a host at the mirror
861. Fetch the public PGP key from your aptly repository and add it to your trusted repositories 861. Fetch the public PGP key from your aptly repository and add it to your trusted repositories
87 87
88 ``` 88 ```
89 wget http://FQDN.OF.APTLY/aptly_repo_key.pub 89 wget http://FQDN.OF.APTLY/aptly_repo_signing.key
90 apt-key add aptly_repo_key.pub 90 apt-key add aptly_repo_signing.key
91 ``` 91 ```
92 92
932. Backup then replace /etc/apt/sources.list 932. Backup then replace /etc/apt/sources.list
diff --git a/assets/startup.sh b/assets/startup.sh
index 9e25f42..46d21f0 100755
--- a/assets/startup.sh
+++ b/assets/startup.sh
@@ -3,6 +3,8 @@
3# If the repository GPG keypair doesn't exist, create it. 3# If the repository GPG keypair doesn't exist, create it.
4if [[ ! -f /opt/aptly/aptly.sec ]] || [[ ! -f /opt/aptly/aptly.pub ]]; then 4if [[ ! -f /opt/aptly/aptly.sec ]] || [[ ! -f /opt/aptly/aptly.pub ]]; then
5 /opt/gpg_batch.sh 5 /opt/gpg_batch.sh
6 # If your system doesn't have a lot of entropy this may, take a long time
7 # Google how-to create "artificial" entropy if this gets stuck
6 gpg --batch --gen-key /opt/gpg_batch 8 gpg --batch --gen-key /opt/gpg_batch
7fi 9fi
8 10
diff --git a/shell.sh b/shell.sh
index 6c4fc78..4c5bf04 100755
--- a/shell.sh
+++ b/shell.sh
@@ -2,11 +2,13 @@
2 2
3source vars 3source vars
4 4
5PYTHON=`which python || which python3`
6
5docker inspect ${APP_NAME} > /dev/null 2>&1 7docker inspect ${APP_NAME} > /dev/null 2>&1
6if [[ $? -ne 0 ]]; then 8if [[ $? -ne 0 ]]; then
7 echo "The ${APP_NAME} container doesn't appear to exist, exiting" 9 echo "The ${APP_NAME} container doesn't appear to exist, exiting"
8fi 10fi
9 11
10CONTAINER_ID=`docker inspect ${APP_NAME} | python -c 'import sys, json; print json.load(sys.stdin)[0]["Id"]'` 12CONTAINER_ID=`docker inspect ${APP_NAME} | $PYTHON -c 'import sys, json; print(json.load(sys.stdin)[0]["Id"])'`
11 13
12docker exec -it ${CONTAINER_ID} /bin/bash 14docker exec -it ${CONTAINER_ID} /bin/bash
diff --git a/vars b/vars
index 15a673e..ef1c2a9 100644
--- a/vars
+++ b/vars
@@ -14,7 +14,7 @@ EMAIL_ADDRESS=user@example.com
14# Password used to encrypt the signing key 14# Password used to encrypt the signing key
15GPG_PASSWORD=repo1234 15GPG_PASSWORD=repo1234
16# The directory on the Docker host to store repository data 16# The directory on the Docker host to store repository data
17APTLY_DATADIR=/path/to/lots/of/space 17APTLY_DATADIR=/tmp/path/to/lots/of/space
18# FQDN of the Docker host that the aptly container will run on 18# FQDN of the Docker host that the aptly container will run on
19HOSTNAME=aptly.example.com 19HOSTNAME=aptly.example.com
20# TCP port that aptly will be reachable on, set to something else if you already 20# TCP port that aptly will be reachable on, set to something else if you already