-2

I need the mongo shell installed inside the ansible-operator image.

My first attempt was to use this Dockerfile:

FROM mongo:4.2.9

FROM quay.io/operator-framework/ansible-operator:v1.0.0
COPY --from=0 /usr/bin/mongo /usr/bin/mongo

COPY requirements.yml ${HOME}/requirements.yml
RUN ansible-galaxy collection install -r ${HOME}/requirements.yml \
 && chmod -R ug+rwx ${HOME}/.ansible

COPY watches.yaml ${HOME}/watches.yaml
COPY roles/ ${HOME}/roles/
COPY playbooks/ ${HOME}/playbooks/

Unsurprisingly, this didn't worked.

"stderr_lines": ["/usr/bin/mongo: /lib64/libcurl.so.4: no version information available (required by /usr/bin/mongo)", "Failed global initialization: InvalidSSLConfiguration Can not set up PEM key file."]

Can anyone help me?

4

1 回答 1

0

I finally figured it out...

Just add this to your Dockerfile. (mongodb-org-4.2.repo)

USER 0
COPY mongodb-org-4.2.repo /etc/yum.repos.d/mongodb-org-4.2.repo
RUN yum -y update \
    && yum install -y mongodb-org-shell \
    && yum clean all \
    && rm -rf /var/cache/yum
RUN rm /etc/yum.repos.d/mongodb-org-4.2.repo
USER ${USER_UID}
于 2020-09-11T00:38:44.047 回答