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
This commit is contained in:
Bryan Hong 2017-05-23 05:26:27 +00:00
parent 58f1859003
commit f2e3ac91dd
5 changed files with 13 additions and 7 deletions

View File

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

View File

@ -86,8 +86,8 @@ Point a host at the mirror
1. Fetch the public PGP key from your aptly repository and add it to your trusted repositories 1. Fetch the public PGP key from your aptly repository and add it to your trusted repositories
``` ```
wget http://FQDN.OF.APTLY/aptly_repo_key.pub wget http://FQDN.OF.APTLY/aptly_repo_signing.key
apt-key add aptly_repo_key.pub apt-key add aptly_repo_signing.key
``` ```
2. Backup then replace /etc/apt/sources.list 2. Backup then replace /etc/apt/sources.list

View File

@ -3,6 +3,8 @@
# If the repository GPG keypair doesn't exist, create it. # If the repository GPG keypair doesn't exist, create it.
if [[ ! -f /opt/aptly/aptly.sec ]] || [[ ! -f /opt/aptly/aptly.pub ]]; then if [[ ! -f /opt/aptly/aptly.sec ]] || [[ ! -f /opt/aptly/aptly.pub ]]; then
/opt/gpg_batch.sh /opt/gpg_batch.sh
# If your system doesn't have a lot of entropy this may, take a long time
# Google how-to create "artificial" entropy if this gets stuck
gpg --batch --gen-key /opt/gpg_batch gpg --batch --gen-key /opt/gpg_batch
fi fi

View File

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

2
vars
View File

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