# 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. FROM ubuntu:16.04 as aptly ARG APTLY_CONFIG_PATH=etc/aptly.conf ARG MIRROR_SOURCE_DIR=sources ARG RELEASE_SIGN_KEY_PATH=etc ARG RELEASE_SIGN_KEY_PASSPHRASE RUN apt-get update RUN apt-get install -y wget 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_DIR}" /opt/sources 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 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}"