Browse Source

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
Bryan Hong 1 year ago
parent
commit
f2e3ac91dd
5 changed files with 13 additions and 7 deletions
  1. 5
    3
      Dockerfile
  2. 2
    2
      README.md
  3. 2
    0
      assets/startup.sh
  4. 3
    1
      shell.sh
  5. 1
    1
      vars

+ 5
- 3
Dockerfile View File

@@ -12,19 +12,21 @@
12 12
 # See the License for the specific language governing permissions and
13 13
 # limitations under the License.
14 14
 
15
-FROM ubuntu:14.04
15
+FROM ubuntu:trusty
16 16
 
17 17
 MAINTAINER bryan@turbojets.net
18 18
 
19 19
 ENV DEBIAN_FRONTEND noninteractive
20
+ENV DIST=ubuntu
21
+ENV RELEASE=trusty
20 22
 
21 23
 # Add Aptly repository
22 24
 RUN echo "deb http://repo.aptly.info/ squeeze main" > /etc/apt/sources.list.d/aptly.list
23 25
 RUN apt-key adv --keyserver keys.gnupg.net --recv-keys 9E3E53F19C7DE460
24 26
 
25 27
 # Add Nginx repository
26
-RUN echo "deb http://nginx.org/packages/ubuntu/ trusty nginx" > /etc/apt/sources.list.d/nginx.list
27
-RUN echo "deb-src http://nginx.org/packages/ubuntu/ trusty nginx" >> /etc/apt/sources.list.d/nginx.list
28
+RUN echo "deb http://nginx.org/packages/$DIST/ $RELEASE nginx" > /etc/apt/sources.list.d/nginx.list
29
+RUN echo "deb-src http://nginx.org/packages/$DIST/ $RELEASE nginx" >> /etc/apt/sources.list.d/nginx.list
28 30
 RUN apt-key adv --keyserver hkp://pgp.mit.edu:80 --recv-keys 573BFD6B3D8FBC641079A6ABABF5BD827BD9BF62
29 31
 
30 32
 # Update APT repository and install packages

+ 2
- 2
README.md View File

@@ -86,8 +86,8 @@ Point a host at the mirror
86 86
 1. 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
90
- apt-key add aptly_repo_key.pub
89
+ wget http://FQDN.OF.APTLY/aptly_repo_signing.key
90
+ apt-key add aptly_repo_signing.key
91 91
  ```
92 92
 
93 93
 2. Backup then replace /etc/apt/sources.list

+ 2
- 0
assets/startup.sh View File

@@ -3,6 +3,8 @@
3 3
 # If the repository GPG keypair doesn't exist, create it.
4 4
 if [[ ! -f /opt/aptly/aptly.sec ]] || [[ ! -f /opt/aptly/aptly.pub ]]; then
5 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 8
   gpg --batch --gen-key /opt/gpg_batch
7 9
 fi
8 10
 

+ 3
- 1
shell.sh View File

@@ -2,11 +2,13 @@
2 2
 
3 3
 source vars
4 4
 
5
+PYTHON=`which python || which python3`
6
+
5 7
 docker inspect ${APP_NAME} > /dev/null 2>&1
6 8
 if [[ $? -ne 0 ]]; then
7 9
   echo "The ${APP_NAME} container doesn't appear to exist, exiting"
8 10
 fi
9 11
 
10
-CONTAINER_ID=`docker inspect ${APP_NAME} | python -c 'import sys, json; print json.load(sys.stdin)[0]["Id"]'`
12
+CONTAINER_ID=`docker inspect ${APP_NAME} | $PYTHON -c 'import sys, json; print(json.load(sys.stdin)[0]["Id"])'`
11 13
 
12 14
 docker exec -it ${CONTAINER_ID} /bin/bash

+ 1
- 1
vars View File

@@ -14,7 +14,7 @@ EMAIL_ADDRESS=user@example.com
14 14
 # Password used to encrypt the signing key
15 15
 GPG_PASSWORD=repo1234
16 16
 # The directory on the Docker host to store repository data
17
-APTLY_DATADIR=/path/to/lots/of/space
17
+APTLY_DATADIR=/tmp/path/to/lots/of/space
18 18
 # FQDN of the Docker host that the aptly container will run on 
19 19
 HOSTNAME=aptly.example.com
20 20
 # TCP port that aptly will be reachable on, set to something else if you already

Loading…
Cancel
Save