0

Docker file that's supposed to install cloud sdk and python 3.7 is skipping the cloud sdk and only running the python3.7 step.

Dockerfile:

FROM google/cloud-sdk:247.0.0

FROM python:3.7
WORKDIR /test
COPY . .
RUN python3 -m pip install -U pip
  • build image: docker build -t test -t test . check python3.7 installation: docker run test python3 --version . output: Python 3.7.9
  • check gcloudsdk installation: docker run test gcloud version. output: docker: Error response from daemon: OCI runtime create failed: container_linux.go:349: starting container process caused "exec: \"gcloud\": executable file not found in $PATH": unknown. ERRO[0000] error waiting for container: context canceled
kudeh
  • 883
  • 1
  • 5
  • 16
  • It doesn't look like you do anything in the first stage. What result are you expecting? – David Maze Nov 06 '20 at 21:05
  • @DavidMaze I want to install cloudsdk then install python3.7. – kudeh Nov 06 '20 at 21:13
  • 2
    This multiple-`FROM` syntax creates two separate images; see for example [Multiple FROMs - what it means](https://stackoverflow.com/questions/33322103/multiple-froms-what-it-means). There's no way to combine two images. I'd suggest starting `FROM python` and then installing the Google Cloud SDK separately. – David Maze Nov 06 '20 at 21:19

1 Answers1

0

An answer from David Maze:

This multiple-FROM syntax creates two separate images; see for example Multiple FROMs - what it means. There's no way to combine two images. I'd suggest starting FROM python and then installing the Google Cloud SDK separately.

Donnald Cucharo
  • 3,866
  • 1
  • 10
  • 17