首页 > 解决方案 > 尝试为 jenkins 和 ansible 构建更新的 Docker Image

问题描述

我正在尝试使用 jenkins 和 ansible 创建 docker 映像,但我收到 python3 警告说它已过时我已尝试添加 yum install python3 --upgrade ,但没​​有成功。

docker-compose.yaml

version: '3'
services:
  jansible:
    container_name: jansible
    image: jansible
    build:
      context: jansible
    ports:
      - "9090:8080"
    volumes:
      - $PWD/jenkins_home:/var/jenkins_home
    networks:
      - net
networks:
  net:

码头文件:

FROM jenkins/jenkins
USER root
RUN apt-get update && apt-get install python3-pip -y && \
pip3 install ansible --upgrade
USER jenkins

docker exec -it jansible bash

jenkins@6b79af149169:/$ ansible - playbook /usr/local/lib/python3.5/dist-packages/ansible/parsing/vault/init .py:44: CryptographyDeprecationWarning: Python 3.5 support will be dropped in the next release ofcryptography. 请升级您的 Python。

jenkins@6b79af149169:/$ python3 --version

Python 3.5.3

标签: pythondockerjenkinsdocker-composeansible

解决方案


推荐阅读