Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Boot2Docker to Google Compute Engine VM: saving Docker container

I am running Boot2Docker v1.0.1 on Windows, and wish to fire up a Docker container I have created on a Google Compute Engine VM.

In order to do so, I need to save the container and upload it to Google Cloud Storage. I issue the following command:

docker save --output=mycontainer.tar mycontainer:latest

The command completes without error. However, I cannot find the rce_env.tar file anywhere on my hard drive.

Does anyone have any experience with this? If not, is there a better way to run containers on GCE VM's?

like image 599
kungfuspider Avatar asked Aug 02 '26 13:08

kungfuspider


1 Answers

You can run google/docker-registry locally to push your container images to GCS.

docker run -ti --name gcloud-config google/cloud-sdk \
  gcloud auth login
docker run -ti --volumes-from gcloud-config google/cloud-sdk \
  gcloud config set project <project>
docker run -d -e GCS_BUCKET=bucketname -p 5000:5000 \
  --volumes-from gcloud-config google/docker-registry
docker tag imagename localhost:5000/imagename
docker push localhost:5000/imagename

And then run it on GCE to pull your containers from GCS.

docker run -d -e GCS_BUCKET=bucketname -p 5000:5000 google/docker-registry
docker run localhost:5000/imagename
like image 54
proppy Avatar answered Aug 05 '26 12:08

proppy