У меня есть следующий Dockerfile с содержимым:
FROM ubuntu:bionic AS os
RUN apt-get update
RUN apt-get install -y git
RUN git --version
FROM node:13.10.1-buster-slim
FROM python:3.7.7-slim-stretch as test
RUN pip install --user pipenv
RUN git --version
RUN git clone git@gitlab.com:silentdata/cdtc-identity-service.git
WORKDIR cdtc-identity-service
RUN pipenv install
CMD python service_test.py
При построении изображения я получаю следующий вывод:
Sending build context to Docker daemon 43.59MB
Step 1/12 : FROM ubuntu:bionic AS os
---> 72300a873c2c
Step 2/12 : RUN apt-get update
---> Using cache
---> 42013f860b31
Step 3/12 : RUN apt-get install -y git
---> Using cache
---> 8f27d95fcb6e
Step 4/12 : RUN git --version
---> Using cache
---> ae49a9465233
Step 5/12 : FROM node:13.10.1-buster-slim
---> 500c5a190476
Step 6/12 : FROM python:3.7.7-slim-stretch as test
---> c9ec5ac0f580
Step 7/12 : RUN pip install --user pipenv
---> Using cache
---> 3a9358e72deb
Step 8/12 : RUN git --version
---> Running in 545659570a84
/bin/sh: 1: git: not found
The command '/bin/sh -c git --version' returned a non-zero code: 127
Почему команда git
не может быть найден во второй раз?