Here’s a couple of steps to move a Docker image to the Google Container Registry.
Create a container image.
docker build -t gcr.io/${PROJECT_ID}/my-app:v1 . |
Push image to GCR.
docker push gcr.io/[PROJECT-ID]/[IMAGE] |
cloud engineer
Here’s a couple of steps to move a Docker image to the Google Container Registry.
Create a container image.
docker build -t gcr.io/${PROJECT_ID}/my-app:v1 . |
docker build -t gcr.io/${PROJECT_ID}/my-app:v1 .
Push image to GCR.
docker push gcr.io/[PROJECT-ID]/[IMAGE] |
docker push gcr.io/[PROJECT-ID]/[IMAGE]
This Docker image contains Apache (httpd), a web server.
Here’s the Dockerfile.
FROM httpd:2.4 COPY ./public-html/ /usr/local/apache2/htdocs/ |
FROM httpd:2.4 COPY ./public-html/ /usr/local/apache2/htdocs/
Build and run your Docker image.
docker build -t my-app . docker run -dit --name my-running-app -p 8080:80 my-app |
docker build -t my-app . docker run -dit --name my-running-app -p 8080:80 my-app
Visit http://localhost:8080 to view your app.