Hi, I am trying to use a container image that I built to make a Python guestbook app that works with a Redis deployment (used Google deployment-manager solution for this Redis deployment). Used the following Dockerfile:
FROM ubuntu:latest
RUN apt-get update &&
apt-get install -y python-dev python-pip &&
pip install redis flask
ADD app /app
EXPOSE 5000
CMD [ "python", "/app/app.py" ]
using the command "gcloud builds submit –tag gcr.io/my_proj/gb-redis ."
The image was built successfully:
DONE
ID CREATE_TIME DURATION SOURCE IMAGES STATUS
f780d9b3-7fcb-44e5-bb89-3eb1653d0015 2019-06-26T01:01:56+00:00 1M52S gs://my_proj_cloudbuild/source/1561510915.26-3a750b915a1048618918f382ab3b994e.tgz gcr.io/my_proj/gb-redis (+1 more) SUCCESS
But when I create a compute instance with the above image using the command "gcloud compute instances create-with-container gb-mnori-try –container-image=gcr.io/my_proj/gb-redis –zone=us-central1-b –tags=cep-allow-ssh,allow-http" and then SSH into it I don’t see the dir /app
mnori@gb-mnori-try ~ $ cd /app
-bash: cd: /app: No such file or directory
May I please know what am missing?
Regards,
Madhavi
Is there any chance you were in a different directory when you did
docker build .
? There’s nothing wrong with that Dockerfile.