| # Copyright 2021 The Chromium OS Authors. All rights reserved. | |
| # Use of this source code is governed by a BSD-style license that can be | |
| # found in the LICENSE file. | |
| ARG BASE_REGISTRY_URI=us-docker.pkg.dev/chromeos-partner-moblab/base-containers | |
| ARG REGISTRY_URI=us-docker.pkg.dev/chromeos-partner-moblab/satlab | |
| ARG COMMON_CORE_LABEL=autopush | |
| ARG COMMON_CORE_URI=gcr.io/chromeos-partner-moblab | |
| ########################################################### | |
| # TODO(prasadv): Read tag from Moblab Labels | |
| FROM ${COMMON_CORE_URI}/moblab_common:${COMMON_CORE_LABEL} AS common | |
| ########################################################### | |
| FROM ${BASE_REGISTRY_URI}/docker/compose:alpine-1.27.4 | |
| RUN apk add --no-cache --upgrade \ | |
| alpine-sdk \ | |
| cmake \ | |
| gcc \ | |
| jq \ | |
| libffi-dev \ | |
| libstdc++ \ | |
| linux-headers \ | |
| openssh-client \ | |
| openssl-dev \ | |
| py-pip \ | |
| python3 \ | |
| python3-dev \ | |
| py3-setuptools \ | |
| zlib-dev | |
| # If the args left empty the script will leave the values in .env as is. | |
| ARG ATS_VER | |
| ARG BOLS_VER | |
| ARG CONF_CREATOR_VER | |
| ARG DNS_VER | |
| ARG DOWNLOADER_VER | |
| ARG DUALCONDUIT_VER | |
| ARG ENVOY_PROXY_VER | |
| ARG LABSERVICE_VER | |
| ARG LOGROTATE_VER | |
| ARG NGINX_VER | |
| ARG OPENSSH_SERVER_VER | |
| ARG OPENTELEMETRY_COLLECTOR_VER | |
| ARG PASSPORT_VER | |
| ARG SATLAB_DRONE_VER | |
| ARG SATLAB_RPCSERVER_VER | |
| ARG SATLAB_UI_VER | |
| # These are re-defined because ARG has a different scope | |
| # before and after the FROM instruction. | |
| ARG BASE_REGISTRY_URI=us-docker.pkg.dev/chromeos-partner-moblab/base-containers | |
| ARG REGISTRY_URI=us-docker.pkg.dev/chromeos-partner-moblab/satlab | |
| ARG SFP_REGISTRY_URI=us-docker.pkg.dev/chromeos-partner-moblab/satlab-for-partners | |
| ARG LABEL=autopush | |
| ARG COMMON_CORE_LABEL=autopush | |
| ARG COMMON_CORE_URI=gcr.io/chromeos-partner-moblab` | |
| ARG BUILD_VERSION | |
| ENV LABEL="${LABEL}" | |
| ENV COMMON_CORE_LABEL="${COMMON_CORE_LABEL}" | |
| ENV COMMON_CORE_URI="${COMMON_CORE_URI}" | |
| ENV REGISTRY_URI="${REGISTRY_URI}" | |
| ENV SFP_REGISTRY_URI="${SFP_REGISTRY_URI}" | |
| ENV BUILD_VERSION="${BUILD_VERSION}" | |
| COPY dockerfiles/compose/requirements.txt ./ | |
| RUN pip3 install --upgrade pip && pip3 install --no-cache-dir -r requirements.txt | |
| WORKDIR /install | |
| COPY --from=common /install/* . | |
| RUN pip install *.whl | |
| RUN rm -rf /install | |
| WORKDIR / | |
| COPY dockerfiles/satlab_remote_access/tools/host_command.py \ | |
| dockerfiles/satlab_remote_access/tools/get_host_identifier \ | |
| dockerfiles/satlab_remote_access/tools/get_host_ip \ | |
| dockerfiles/satlab_remote_access/tools/get_host_mac \ | |
| dockerfiles/satlab_remote_access/tools/get_host_os_version \ | |
| tools/update_satlab_config_override.py /usr/local/bin/ | |
| RUN chmod uog+rx /usr/local/bin/get_host_identifier \ | |
| && chmod uog+rx /usr/local/bin/get_host_ip \ | |
| && chmod uog+rx /usr/local/bin/get_host_mac \ | |
| && chmod uog+rx /usr/local/bin/get_host_os_version | |
| COPY dockerfiles/compose/docker-compose.yaml . | |
| COPY dockerfiles/compose/docker-compose.watchtower.yaml . | |
| COPY dockerfiles/compose/.env main.env | |
| COPY dockerfiles/compose/override.env* . | |
| COPY dockerfiles/compose/compose_startup.sh . | |
| RUN chmod u+x compose_startup.sh | |
| COPY dockerfiles/compose/override_service_version.sh . | |
| RUN chmod u+x override_service_version.sh | |
| RUN ./override_service_version.sh ATS ${ATS_VER:-${BUILD_VERSION}} \ | |
| && ./override_service_version.sh BOLS ${BOLS_VER:-${BUILD_VERSION}} \ | |
| && ./override_service_version.sh CONF_CREATOR ${CONF_CREATOR_VER:-${BUILD_VERSION}} \ | |
| && ./override_service_version.sh DNS ${DNS_VER:-${BUILD_VERSION}} \ | |
| && ./override_service_version.sh DOWNLOADER ${DOWNLOADER_VER:-${BUILD_VERSION}} \ | |
| && ./override_service_version.sh DUALCONDUIT ${DUALCONDUIT_VER:-${BUILD_VERSION}} \ | |
| && ./override_service_version.sh ENVOY_PROXY ${ENVOY_PROXY_VER:-${BUILD_VERSION}} \ | |
| && ./override_service_version.sh LABSERVICE ${LABSERVICE_VER:-${BUILD_VERSION}} \ | |
| && ./override_service_version.sh LOGROTATE ${LOGROTATE_VER:-${BUILD_VERSION}} \ | |
| && ./override_service_version.sh NGINX ${NGINX_VER:-${BUILD_VERSION}} \ | |
| && ./override_service_version.sh OPENSSH_SERVER ${OPENSSH_SERVER_VER:-${BUILD_VERSION}} \ | |
| && ./override_service_version.sh OPENTELEMETRY_COLLECTOR ${OPENTELEMETRY_COLLECTOR_VER:-${BUILD_VERSION}} \ | |
| && ./override_service_version.sh PASSPORT ${PASSPORT_VER:-${BUILD_VERSION}} \ | |
| && ./override_service_version.sh SATLAB_DRONE ${SATLAB_DRONE_VER:-${BUILD_VERSION}} \ | |
| && ./override_service_version.sh SATLAB_RPCSERVER ${SATLAB_RPCSERVER_VER:-${BUILD_VERSION}} \ | |
| && ./override_service_version.sh SATLAB_UI ${SATLAB_UI_VER:-${BUILD_VERSION}} | |
| # Add routine to check export environment variable from .env file | |
| COPY tools/export_env_file.sh / | |
| RUN chmod 777 /export_env_file.sh | |
| # Add routine to create local stable version directory | |
| COPY tools/create_recovery_version_dir.sh / | |
| RUN chmod 777 /create_recovery_version_dir.sh | |
| ENTRYPOINT ["/compose_startup.sh"] | |
| # Test the config for syntax errors | |
| RUN docker-compose config |