diff --git a/ansible-runner/context/app/project/roles/mirror_appliance/tasks/autodetect-image-archive.yaml b/ansible-runner/context/app/project/roles/mirror_appliance/tasks/autodetect-image-archive.yaml index b2493f4..230a4b6 100755 --- a/ansible-runner/context/app/project/roles/mirror_appliance/tasks/autodetect-image-archive.yaml +++ b/ansible-runner/context/app/project/roles/mirror_appliance/tasks/autodetect-image-archive.yaml @@ -26,10 +26,10 @@ - name: Loading Quay if quay.tar exists shell: - cmd: podman image import --change 'ENV PATH=/.local/bin/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin' --change 'ENV RED_HAT_QUAY=true' --change 'ENV PYTHON_VERSION=3.8' --change 'ENV PYTHON_ROOT=/usr/local/lib/python3.8' --change 'ENV PYTHONUNBUFFERED=1' --change 'ENV PYTHONIOENCODING=UTF-8' --change 'ENV LANG=en_US.utf8' --change 'ENV QUAYDIR=/quay-registry' --change 'ENV QUAYCONF=/quay-registry/conf' --change 'ENV QUAYRUN=/quay-registry/conf' --change 'ENV QUAYPATH=.' --change "ENV QUAY_VERSION={{ quay_version }}" --change 'ENV container=oci' --change 'ENTRYPOINT=["dumb-init","--","/quay-registry/quay-entrypoint.sh"]' --change 'WORKDIR=/quay-registry' --change 'EXPOSE=7443' --change 'EXPOSE=8080' --change 'EXPOSE=8443' --change 'VOLUME=/conf/stack' --change 'VOLUME=/datastorage' --change 'VOLUME=/tmp' --change 'VOLUME=/var/log' --change 'USER=1001' --change 'CMD ["registry"]' - {{ quay_image }} < {{ quay_root }}/quay.tar + cmd: podman image import --change 'ENV container=oci' --change 'ENV PATH=/app/bin/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin' --change 'ENV PYTHONUNBUFFERED=1' --change 'ENV PYTHONIOENCODING=UTF-8' --change 'ENV LC_ALL=C.UTF-8' --change 'ENV LANG=C.UTF-8' --change 'ENV QUAYDIR=/quay-registry' --change 'ENV QUAYCONF=/quay-registry/conf' --change 'ENV QUAYRUN=/quay-registry/conf' --change 'ENV QUAYPATH=/quay-registry' --change 'ENV PYTHONUSERBASE=/app' --change 'ENV PYTHONPATH=/quay-registry' --change 'ENV TZ=UTC' --change 'ENV RED_HAT_QUAY=true' --change 'ENTRYPOINT=["dumb-init","--","/quay-registry/quay-entrypoint.sh"]' --change 'WORKDIR=/quay-registry' --change 'EXPOSE=7443' --change 'EXPOSE=8080' --change 'EXPOSE=8443' --change 'VOLUME=/conf/stack' --change 'VOLUME=/datastorage' --change 'VOLUME=/tmp' --change 'VOLUME=/var/log' --change 'USER=1001' --change 'CMD ["registry"]' - {{ quay_image }} < {{ quay_root }}/quay.tar when: p.stat.exists and local_install == "false" - name: Loading Postgres if postgres.tar exists shell: cmd: podman image import --change 'ENV PATH=/opt/app-root/src/bin:/opt/app-root/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin' --change 'ENV STI_SCRIPTS_URL=image:///usr/libexec/s2i' --change 'ENV STI_SCRIPTS_PATH=/usr/libexec/s2i' --change 'ENV APP_ROOT=/opt/app-root' --change 'ENV APP_DATA=/opt/app-root' --change 'ENV HOME=/var/lib/pgsql' --change 'ENV PLATFORM=el8' --change 'ENV POSTGRESQL_VERSION=10' --change 'ENV POSTGRESQL_PREV_VERSION=9.6' --change 'ENV PGUSER=postgres' --change 'ENV CONTAINER_SCRIPTS_PATH=/usr/share/container-scripts/postgresql' --change 'ENTRYPOINT=["container-entrypoint"]' --change 'WORKDIR=/opt/app-root/src' --change 'EXPOSE=5432' --change 'USER=26' --change 'CMD ["run-postgresql"]' - {{ postgres_image }} < {{ quay_root }}/postgres.tar - when: p.stat.exists and local_install == "false" \ No newline at end of file + when: p.stat.exists and local_install == "false" diff --git a/cmd/utils.go b/cmd/utils.go index d3e9a29..d678bc9 100644 --- a/cmd/utils.go +++ b/cmd/utils.go @@ -244,21 +244,21 @@ func getImageMetadata(app, imageName, archivePath string) string { - ` + imageName + ` < ` + archivePath case "quay": // quay.io - quayVersion := strings.Split(imageName, ":")[1] statement = `/usr/bin/podman image import \ - --change 'ENV PATH=/.local/bin/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin' \ - --change 'ENV RED_HAT_QUAY=true' \ - --change 'ENV PYTHON_VERSION=3.8' \ - --change 'ENV PYTHON_ROOT=/usr/local/lib/python3.8' \ + --change 'ENV container=oci' \ + --change 'ENV PATH=/app/bin/:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin' \ --change 'ENV PYTHONUNBUFFERED=1' \ --change 'ENV PYTHONIOENCODING=UTF-8' \ - --change 'ENV LANG=en_US.utf8' \ + --change 'ENV LC_ALL=C.UTF-8' \ + --change 'ENV LANG=C.UTF-8' \ --change 'ENV QUAYDIR=/quay-registry' \ --change 'ENV QUAYCONF=/quay-registry/conf' \ --change 'ENV QUAYRUN=/quay-registry/conf' \ - --change 'ENV QUAYPATH=.' \ - --change 'ENV QUAY_VERSION=` + quayVersion + `' \ - --change 'ENV container=oci' \ + --change 'ENV QUAYPATH=/quay-registry' \ + --change 'ENV PYTHONUSERBASE=/app' \ + --change 'ENV PYTHONPATH=/quay-registry' \ + --change 'ENV TZ=UTC' \ + --change 'ENV RED_HAT_QUAY=true' \ --change 'ENTRYPOINT=["dumb-init","--","/quay-registry/quay-entrypoint.sh"]' \ --change 'WORKDIR=/quay-registry' \ --change 'EXPOSE=7443' \