be9c3b6c13
This adds environment variables for the build script that can be set to individually override the base ubuntu build image for mini-mirror as well as the final nginx image. This does not change the deafult functionality and allows the mini-mirror build to be more configurable if the end user wishes to substitute in their own images Change-Id: I49e0415354ce8953b759de92367849b8f9ece50b
50 lines
1.6 KiB
Docker
50 lines
1.6 KiB
Docker
# Copyright 2019, AT&T Intellectual Property
|
|
#
|
|
# Licensed under the Apache License, Version 2.0 (the "License");
|
|
# you may not use this file except in compliance with the License.
|
|
# You may obtain a copy of the License at
|
|
#
|
|
# http://www.apache.org/licenses/LICENSE-2.0
|
|
#
|
|
# Unless required by applicable law or agreed to in writing, software
|
|
# distributed under the License is distributed on an "AS IS" BASIS,
|
|
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
# See the License for the specific language governing permissions and
|
|
# limitations under the License.
|
|
|
|
ARG FROM_UBUNTU=ubuntu:16.04
|
|
ARG FROM_NGINX=nginx
|
|
FROM ${FROM_UBUNTU} as aptly
|
|
|
|
ARG APTLY_CONFIG_PATH=etc/aptly.conf
|
|
ARG MIRROR_SOURCE_FILE=mini-mirror-sources.yaml
|
|
ARG RELEASE_SIGN_KEY_PATH=etc
|
|
ARG RELEASE_SIGN_KEY_PASSPHRASE
|
|
|
|
RUN apt-get update
|
|
RUN apt-get install -y wget jq python-pip
|
|
RUN pip install yq
|
|
|
|
COPY "${APTLY_CONFIG_PATH}" /etc/aptly.conf
|
|
COPY tools/install_aptly.sh /opt/install_aptly.sh
|
|
|
|
ARG APTLY_INSTALL_FROM=source
|
|
ARG APTLY_REPO=https://github.com/smstone/aptly.git
|
|
ARG APTLY_REFSPEC=allow-custom-codename
|
|
|
|
RUN /opt/install_aptly.sh
|
|
|
|
COPY "${MIRROR_SOURCE_FILE}" /opt/mini-mirror-sources.yaml
|
|
COPY "${RELEASE_SIGN_KEY_PATH}" /opt/release.gpg
|
|
COPY tools/publish_snapshots.sh /opt/publish_snapshots.sh
|
|
|
|
RUN /opt/publish_snapshots.sh "${RELEASE_SIGN_KEY_PASSPHRASE}"
|
|
|
|
FROM ${FROM_NGINX}
|
|
|
|
ARG APTLY_SNAPSHOT_DIR=/srv
|
|
|
|
# NOTE(drewwalters96): This must match the location provided in the NGINX
|
|
# config file.
|
|
COPY --from=aptly /opt/.aptly/public "${APTLY_SNAPSHOT_DIR}"
|