Files
openstack-helm-images/mini-mirror/Dockerfile.ubuntu_bionic
Phil Sphicas 00401e1d92 Align mini-mirror Dockerfile args with build.sh
The mini-mirror build.sh script has somehow ended up out of sync with
the Dockerfiles, and is not passing the correct build-args to allow base
image overrides.

This change aligns with the standard of using BUILD_FROM (ubuntu) for
the build stage and FROM (nginx) for the final stage.

Relevant earlier changes:
0: https://review.opendev.org/714002
1: https://review.opendev.org/679315

Change-Id: I844efa669c0f11004a44f20f6725338e1d2699b6
2021-02-20 03:34:53 +00:00

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 BUILD_FROM=ubuntu:18.04
ARG FROM=nginx
FROM ${BUILD_FROM} 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 gnupg 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}
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}"