Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DockerHub development version of the TEF Dockerfile terraform.exe image for ADO iteration based off the gcloud image in https://hub.docker.com/r/google/cloud-sdk/ #409

Closed
obriensystems opened this issue Apr 27, 2024 · 6 comments

Comments

@obriensystems
Copy link
Collaborator

obriensystems commented Apr 27, 2024

Create a public sharable development image for use while iterating #399

Dockerfile

branch gh399-ado
repository

https://hub.docker.com/repository/docker/obrienlabs/terraform-example-foundation-ado/general

docker build --rm=true --no-cache --build-arg build-id=$BUILD_ID -t $DOCKERHUB_ORG/$CONTAINER_IMAGE -f $DOCKER_FILE .
docker tag $DOCKERHUB_ORG/$CONTAINER_IMAGE $DOCKERHUB_ORG/$CONTAINER_IMAGE:$RELEASE_ID
docker tag $DOCKERHUB_ORG/$CONTAINER_IMAGE $DOCKERHUB_ORG/$CONTAINER_IMAGE:latest
docker push obrienlabs/$CONTAINER_IMAGE:$RELEASE_ID
docker push obrienlabs/$CONTAINER_IMAGE:latest
michaelobrien@mbp7 docker % cp ../../0-bootstrap/Dockerfile .
michaelobrien@mbp7 docker % pwd
/Users/michaelobrien/wse_github/GoogleCloudPlatform/olapp/pbmm-on-gcp-onboarding/build/docker

michaelobrien@mbp7 docker % docker login
Authenticating with existing credentials...
Login Succeeded
michaelobrien@mbp7 docker % ./build.sh  
[+] Building 94.0s (6/6) FINISHED                                                                                                                    docker:desktop-linux
 => [internal] load build definition from Dockerfile                                                                                                                 0.0s
 => => transferring dockerfile: 2.12kB                                                                                                                               0.0s
 => [internal] load .dockerignore                                                                                                                                    0.0s
 => => transferring context: 2B                                                                                                                                      0.0s
 => [internal] load metadata for gcr.io/cloud-builders/gcloud-slim:latest                                                                                            0.5s
 => [1/2] FROM gcr.io/cloud-builders/gcloud-slim@sha256:5c4dae8efafde5330a63290abd82cadcb9351ec49b0c2d2959663a7ccf3c066e                                            28.9s
 => => resolve gcr.io/cloud-builders/gcloud-slim@sha256:5c4dae8efafde5330a63290abd82cadcb9351ec49b0c2d2959663a7ccf3c066e                                             0.0s
 => => sha256:f0407feee79e9b1a6b305840a28c4f21fdcd7a5cbd8d021eea189e2003999861 3.53kB / 3.53kB                                                                       0.0s
 => => sha256:d2aa1518a716e3219bd8228ab355c1681776240bd2441c10c04dd07b54e824d5 28.57MB / 28.57MB                                                                     1.1s
 => => sha256:76ff73118202b82844cd269ad12341d1335a66a47952d83d3f5717c3f9eb36cb 6.51MB / 6.51MB                                                                       0.8s
 => => sha256:3c2cba919283a210665e480bcbf943eaaf4ed87a83f02e81bb286b8bdead0e75 49B / 49B                                                                             0.3s
 => => sha256:5c4dae8efafde5330a63290abd82cadcb9351ec49b0c2d2959663a7ccf3c066e 1.57kB / 1.57kB                                                                       0.0s
 => => sha256:b32fb4fcf4639942b506c6586ff3245a546500438fa05cfe7f07a11b25e21d37 417.57MB / 417.57MB                                                                   7.4s
 => => sha256:af8c1adcdaeb10e300eef2a9cb0807b735d008723a56bd838e277b594db57b5c 494B / 494B                                                                           1.1s
 => => extracting sha256:d2aa1518a716e3219bd8228ab355c1681776240bd2441c10c04dd07b54e824d5                                                                            0.8s
 => => sha256:f31ad5bb9a076db4cb3dd628bfe532360650ebc4f623c18c178b225c0aadd8c9 166B / 166B                                                                           1.3s
 => => extracting sha256:76ff73118202b82844cd269ad12341d1335a66a47952d83d3f5717c3f9eb36cb                                                                            0.2s
 => => extracting sha256:3c2cba919283a210665e480bcbf943eaaf4ed87a83f02e81bb286b8bdead0e75                                                                            0.0s
 => => extracting sha256:b32fb4fcf4639942b506c6586ff3245a546500438fa05cfe7f07a11b25e21d37                                                                           21.1s
 => => extracting sha256:af8c1adcdaeb10e300eef2a9cb0807b735d008723a56bd838e277b594db57b5c                                                                            0.0s
 => => extracting sha256:f31ad5bb9a076db4cb3dd628bfe532360650ebc4f623c18c178b225c0aadd8c9                                                                            0.0s
 => [2/2] RUN apt-get update &&     /builder/google-cloud-sdk/bin/gcloud -q components install alpha beta terraform-tools &&     apt-get -y install curl jq unzip   57.3s
 => exporting to image                                                                                                                                               7.2s
 => => exporting layers                                                                                                                                              7.2s
 => => writing image sha256:5a1bdf1fc01e6821386d0ee337e1748a7a15f3cc9134daba3ec149e7e34b8c88                                                                         0.0s 
 => => naming to docker.io/library/terraform-example-foundation-ado                                                                                                  0.0s 
            
            
=> [2/2] RUN apt-get update &&     /builder/google-cloud-sdk/bin/gcloud -q components install alpha beta terraform-tools &&     apt-get -y install curl jq unzip   25.7s
 => => # ╔════════════════════════════════════════════════════════════╗                                                                                                  
 => => # ╠═ Installing: Terraform Tools                              ═╣                                                                                                  
 => => # ╚════════════════════════════════════════════════════════════╝                                                                                                  
 => => # ╔════════════════════════════════════════════════════════════╗                                                                                                  
 => => # ╠═ Installing: Terraform Tools                              ═╣     
                                                                                                                                                              
What's Next?                                                                                                                                                              
  View a summary of image vulnerabilities and recommendations → docker scout quickview
michaelobrien@mbp7 docker % 

michaelobrien@mbp7 docker % docker images | grep terraform
terraform-example-foundation-ado                          0.0.1                                                                        5a1bdf1fc01e   About a minute ago   3.49GB
terraform-example-foundation-ado                          latest                                                                       5a1bdf1fc01e   About a minute ago   3.49GB


The push refers to repository [docker.io/obrienlabs/terraform-example-foundation-ado]
1a5ab404dddd: Pushing [=====>                                             ]  215.9MB/1.818GB
600d3bb9c25f: Pushed 
5a3af3daf7a4: Pushed 
3a53c526edc7: Pushing [==========>                                        ]  334.1MB/1.588GB
84ff92691f90: Pushed 
32bfd004bf31: Pushed 
404802fd10b7: Pushed 

The push refers to repository [docker.io/obrienlabs/terraform-example-foundation-ado]
1a5ab404dddd: Pushed 
600d3bb9c25f: Pushed 
5a3af3daf7a4: Pushed 
3a53c526edc7: Pushed 
84ff92691f90: Pushed 
32bfd004bf31: Pushed 
404802fd10b7: Pushed 
0.0.1: digest: sha256:f79fc4937575f143ddc29ca8958f0bf0dd67153587fbc6d05b5379cc16cb2205 size: 1786
The push refers to repository [docker.io/obrienlabs/terraform-example-foundation-ado]
1a5ab404dddd: Layer already exists 
600d3bb9c25f: Layer already exists 
5a3af3daf7a4: Layer already exists 
3a53c526edc7: Layer already exists 
84ff92691f90: Layer already exists 
32bfd004bf31: Layer already exists 
404802fd10b7: Layer already exists 
latest: digest: sha256:f79fc4937575f143ddc29ca8958f0bf0dd67153587fbc6d05b5379cc16cb2205 size: 1786
@obriensystems obriensystems self-assigned this Apr 27, 2024
@obriensystems obriensystems changed the title DockerHub development version of the TEF Dockerfile image for ADO iteration DockerHub development version of the TEF Dockerfile image for ADO iteration based off the gcloud image in https://hub.docker.com/r/google/cloud-sdk/ Apr 27, 2024
@obriensystems
Copy link
Collaborator Author

testing in a GCP cloud shell (intel only - no arm64)

michael@cloudshell:~/tef-olapp/github/terraform-example-foundation (tef-olapp)$ docker run obrienlabs/terraform-example-foundation-ado
Unable to find image 'obrienlabs/terraform-example-foundation-ado:latest' locally
latest: Pulling from obrienlabs/terraform-example-foundation-ado
d2aa1518a716: Pull complete 
76ff73118202: Pull complete 
3c2cba919283: Pull complete 
b32fb4fcf463: Pull complete 
af8c1adcdaeb: Pull complete 
f31ad5bb9a07: Pull complete 
dcdc7d3a5d40: Pull complete 
Digest: sha256:f79fc4937575f143ddc29ca8958f0bf0dd67153587fbc6d05b5379cc16cb2205
Status: Downloaded newer image for obrienlabs/terraform-example-foundation-ado:latest
Usage: terraform [global options] <subcommand> [args]

The available commands for execution are listed below.
The primary workflow commands are given first, followed by
less common or more advanced commands.

Main commands:
  init          Prepare your working directory for other commands
  validate      Check whether the configuration is valid
  plan          Show changes required by the current configuration
  apply         Create or update infrastructure
  destroy       Destroy previously-created infrastructure
  
  get version

michael@cloudshell:~/tef-olapp/github/terraform-example-foundation (tef-olapp)$ docker run obrienlabs/terraform-example-foundation-ado --version
Terraform v1.3.0
on linux_amd64

Your version of Terraform is out of date! The latest version
is 1.8.2. You can update by downloading from https://www.terraform.io/downloads.html

not persistent as expected

michael@cloudshell:~/tef-olapp/github/terraform-example-foundation (tef-olapp)$ docker ps
CONTAINER ID   IMAGE     COMMAND   CREATED   STATUS    PORTS     NAMES
michael@cloudshell:~/tef-olapp/github/terraform-example-foundation (tef-olapp)$ docker ps -a
CONTAINER ID   IMAGE                                         COMMAND                 CREATED              STATUS                            PORTS     NAMES
e5b9119e1b16   obrienlabs/terraform-example-foundation-ado   "terraform --version"   24 seconds ago       Exited (0) 23 seconds ago                   nervous_fermat
ea9792466a42   obrienlabs/terraform-example-foundation-ado   "terraform"             About a minute ago   Exited (127) About a minute ago             priceless_cartwright

@obriensystems obriensystems changed the title DockerHub development version of the TEF Dockerfile image for ADO iteration based off the gcloud image in https://hub.docker.com/r/google/cloud-sdk/ DockerHub development version of the TEF Dockerfile terraform.exe image for ADO iteration based off the gcloud image in https://hub.docker.com/r/google/cloud-sdk/ Apr 27, 2024
@obriensystems
Copy link
Collaborator Author

retest on terraform 1.3.10

The push refers to repository [docker.io/obrienlabs/terraform-example-foundation-ado]
fe0fec718258: Layer already exists 
600d3bb9c25f: Layer already exists 
5a3af3daf7a4: Layer already exists 
3a53c526edc7: Layer already exists 
84ff92691f90: Layer already exists 
32bfd004bf31: Layer already exists 
404802fd10b7: Layer already exists 
latest: digest: sha256:51f797316b959bf66785a183f4fa752d1157dfe3329336fe4bdde53f1be15672 size: 1786
test a terraform exe run on ia64 only - not arm64
WARNING: The requested image's platform (linux/amd64) does not match the detected host platform (linux/arm64/v8) and no specific platform was requested
Terraform v1.3.10
on linux_amd64

@fmichaelobrien
Copy link
Contributor

Continue on #399

obriensystems added a commit that referenced this issue Apr 27, 2024
@obriensystems
Copy link
Collaborator Author

external test

michael@cloudshell:~ (tef-olxyz)$ docker image rm  obrienlabs/terraform-example-foundation-ado:latest -f
Untagged: obrienlabs/terraform-example-foundation-ado:latest
Untagged: obrienlabs/terraform-example-foundation-ado@sha256:f79fc4937575f143ddc29ca8958f0bf0dd67153587fbc6d05b5379cc16cb2205
Deleted: sha256:075b31b3e45cc809a55d9a753483febb99565ac12ef5bc020279a31e3ee74587

ichael@cloudshell:~ (tef-olxyz)$ docker pull obrienlabs/terraform-example-foundation-ado
Using default tag: latest
latest: Pulling from obrienlabs/terraform-example-foundation-ado
d2aa1518a716: Already exists 
76ff73118202: Already exists 
3c2cba919283: Already exists 
b32fb4fcf463: Already exists 
af8c1adcdaeb: Already exists 
f31ad5bb9a07: Already exists 
dcdc7d3a5d40: Already exists 
Digest: sha256:f79fc4937575f143ddc29ca8958f0bf0dd67153587fbc6d05b5379cc16cb2205
Status: Downloaded newer image for obrienlabs/terraform-example-foundation-ado:latest
docker.io/obrienlabs/terraform-example-foundation-ado:latest

michael@cloudshell:~ (tef-olxyz)$ docker ps -a
CONTAINER ID   IMAGE                                         COMMAND                 CREATED          STATUS                      PORTS     NAMES
32d8cb25a27d   obrienlabs/terraform-example-foundation-ado   "terraform --version"   10 seconds ago   Exited (0) 8 seconds ago              gallant_lalande
bd6e090c0f86   obrienlabs/terraform-example-foundation-ado   "terraform --version"   11 minutes ago   Exited (0) 11 minutes ago             frosty_margulis
9fe650daf14c   obrienlabs/terraform-example-foundation-ado   "terraform --version"   13 minutes ago   Exited (0) 13 minutes ago             bold_cartwright
michael@cloudshell:~ (tef-olxyz)$ docker rm gallant_lalande
gallant_lalande
michael@cloudshell:~ (tef-olxyz)$ docker rm frosty_margulis
frosty_margulis
michael@cloudshell:~ (tef-olxyz)$ docker rm bold_cartwright
bold_cartwright
michael@cloudshell:~ (tef-olxyz)$ docker ps -a
CONTAINER ID   IMAGE     COMMAND   CREATED   STATUS    PORTS     NAMES
michael@cloudshell:~ (tef-olxyz)$ docker run --name tef-ado obrienlabs/terraform-example-foundation-ado --version
Terraform v1.3.0
on linux_amd64

Your version of Terraform is out of date! The latest version
is 1.8.2. You can update by downloading from https://www.terraform.io/downloads.html
michael@cloudshell:~ (tef-olxyz)$ docker ps -a
CONTAINER ID   IMAGE                                         COMMAND                 CREATED          STATUS                      PORTS     NAMES
5f074c573888   obrienlabs/terraform-example-foundation-ado   "terraform --version"   12 seconds ago   Exited (0) 12 seconds ago             tef-ado
michael@cloudshell:~ (tef-olxyz)$ docker rm tef-sdo
Error response from daemon: No such container: tef-sdo
michael@cloudshell:~ (tef-olxyz)$ docker rm tef-ado
tef-ado

michael@cloudshell:~ (tef-olxyz)$ docker image rm  obrienlabs/terraform-example-foundation-ado:latest -f
Untagged: obrienlabs/terraform-example-foundation-ado:latest
Untagged: obrienlabs/terraform-example-foundation-ado@sha256:f79fc4937575f143ddc29ca8958f0bf0dd67153587fbc6d05b5379cc16cb2205
Deleted: sha256:075b31b3e45cc809a55d9a753483febb99565ac12ef5bc020279a31e3ee74587
michael@cloudshell:~ (tef-olxyz)$ docker run --name tef-ado obrienlabs/terraform-example-foundation-ado:latest --version
Unable to find image 'obrienlabs/terraform-example-foundation-ado:latest' locally
latest: Pulling from obrienlabs/terraform-example-foundation-ado
d2aa1518a716: Already exists 
76ff73118202: Already exists 
3c2cba919283: Already exists 
b32fb4fcf463: Already exists 
af8c1adcdaeb: Already exists 
f31ad5bb9a07: Already exists 
9a6d62f9bf23: Pull complete 
Digest: sha256:c8a2438c1c6729cf1cd0ab5777bd537757655c6f209137af33b105c17721f369
Status: Downloaded newer image for obrienlabs/terraform-example-foundation-ado:latest
docker: Error response from daemon: Conflict. The container name "/tef-ado" is already in use by container "460dfe4001dd00d33ae6ccd3272adaf7779478dc1ee5f57359bc5ab41eab9830". You have to remove (or rename) that container to be able to reuse that name.
See 'docker run --help'.
michael@cloudshell:~ (tef-olxyz)$ docker ps -a
CONTAINER ID   IMAGE          COMMAND                 CREATED          STATUS                      PORTS     NAMES
460dfe4001dd   075b31b3e45c   "terraform --version"   15 minutes ago   Exited (0) 15 minutes ago             tef-ado
michael@cloudshell:~ (tef-olxyz)$ docker rm -v tef-ado
tef-ado
michael@cloudshell:~ (tef-olxyz)$ docker run --name tef-ado obrienlabs/terraform-example-foundation-ado:latest --version
Terraform v1.3.10
on linux_amd64

Your version of Terraform is out of date! The latest version
is 1.8.2. You can update by downloading from https://www.terraform.io/downloads.html
michael@cloudshell:~ (tef-olxyz)$ 

@obriensystems
Copy link
Collaborator Author

obriensystems commented Apr 27, 2024

Test terraform 1.3.10 image in Azure Devops

Screenshot 2024-04-27 at 18 49 14

via azure-pipeline.yml

trigger:
- main

pool:
  vmImage: ubuntu-latest
- script: |
    docker run obrienlabs/terraform-example-foundation-ado --version 
Screenshot 2024-04-27 at 20 15 11

replaces the artifact registry container build using tf-cloudbuilder
Screenshot 2024-04-27 at 20 30 04

obriensystems added a commit that referenced this issue Apr 27, 2024
Copy link

This issue is stale because it has been open 60 days with no activity. Remove stale label or comment or this will be closed in 7 days

@github-actions github-actions bot added the Stale label Aug 12, 2024
@github-actions github-actions bot closed this as not planned Won't fix, can't repro, duplicate, stale Aug 23, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants