awslabs / aws-terraform-dev-container

A VSCode Dev Container with tools to help you build and manage AWS infrastructure with Terraform
MIT No Attribution
137 stars 21 forks source link

Install did not work on Mac M1 #2

Closed askulkarni2 closed 1 year ago

askulkarni2 commented 2 years ago

Steps to Reproduce:

  1. curl -sL https://raw.githubusercontent.com/awslabs/aws-terraform-dev-container/main/scripts/init.sh | bash
  2. Reload in container
Logs ```sh ...(earlier logs skipped) => [internal] load build definition from Dockerfile-with-features 0.0s => => transferring dockerfile: 4.99kB 0.0s => [internal] load .dockerignore 0.0s => => transferring context: 2B 0.0s => [internal] load metadata for mcr.microsoft.com/vscode/devcontainers/b 0.0s => [internal] load build context 0.0s => => transferring context: 35B 0.0s => [dev_container_auto_added_stage_label 1/18] FROM mcr.microsoft.com/v 0.0s => CACHED [dev_container_auto_added_stage_label 2/18] RUN apt-get updat 0.0s => CACHED [dev_container_auto_added_stage_la [2022-11-04T23:47:53.148Z] bel 3/18] RUN update-ca-cer 0.0s => [dev_container_auto_added_stage_label 4/18] RUN curl -fsSL https:// 13.1s => => # Hit:4 http://ports.ubuntu.com/ubuntu-ports jammy-backports InRelease => => # Hit:5 http://ports.ubuntu.com/ubuntu-ports jammy-security InRelease => => # Reading package lists... => => # W: https://apt.releases.hashicorp.com/dists/jammy/InRelease: Key is st => => # ored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEP => => # RECATION section in apt-key(8) for details. [2022-11-04T23:47:53.298Z] [+] Building 13.3s (7/22) [2022-11-04T23:47:53.299Z] => [internal] load build definition from Dockerfile-with-features 0.0s => => transferring dockerfile: 4.99kB 0.0s => [internal] load .dockerignore 0.0s => => transferring context: 2B 0.0s => [internal] load metadata for mcr.microsoft.com/vscode/devcontainers/b 0.0s => [internal] load build context 0.0s => => transferring context: 35B 0.0s => [dev_container_auto_added_stage_label 1/18] FROM mcr.microsoft.com/v 0.0s => CACHED [dev_container_auto_added_stage_label 2/18] RUN apt-get updat 0.0s => CACHED [dev_container_auto_added_stage_label 3/18] RUN update-ca-cer 0.0s => [dev_container_auto_added_stage_label 4/18] RUN curl -fsSL https:// 13.2s => => # Hit:4 http://ports.ubuntu.com/ [2022-11-04T23:47:53.299Z] ubuntu-ports jammy-backports InRelease => => # Hit:5 http://ports.ubuntu.com/ubuntu-ports jammy-security InRelease => => # Reading package lists... => => # W: https://apt.releases.hashicorp.com/dists/jammy/InRelease: Key is st => => # ored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEP => => # RECATION section in apt-key(8) for details. [2022-11-04T23:47:53.367Z] [+] Building 13.4s (8/22) => [internal] load build definition from Dockerfile-with-features 0.0s => => transferring dockerfile: 4.99kB 0.0s => [internal] load .dockerignore 0.0s => => transferring context: 2B 0.0s => [internal] load metadata for mcr.microsoft.com/vscode/devcontainers/b 0.0s => [internal] load build context 0.0s => => transferring context: 35B 0.0s => [dev_container_auto_added_stage_label 1/18] FROM mcr.microsoft.com/v 0.0s => CACHED [dev_container_auto_added_stage_label 2/18] RUN apt-get updat 0.0s => CACHED [dev_container_auto_added_stage_la [2022-11-04T23:47:53.371Z] bel 3/18] RUN update-ca-cer 0.0s => ERROR [dev_container_auto_added_stage_label 4/18] RUN curl -fsSL ht 13.3s ------ > [dev_container_auto_added_stage_label 4/18] RUN curl -fsSL https://apt.releases.hashicorp.com/gpg | sudo apt-key add - && apt-add-repository "deb [arch=amd64] https://apt.releases.hashicorp.com $(lsb_release -cs) main" && apt-get update && sudo apt-get -qq install --no-install-recommends --yes terraform terraform-ls: #0 0.186 Warning: apt-key is deprecated. Manage keyrin [2022-11-04T23:47:53.371Z] g files in trusted.gpg.d instead (see apt-key(8)). #0 0.347 OK #0 1.068 Get:1 https://apt.releases.hashicorp.com jammy InRelease [12.0 kB] #0 1.281 Get:2 https://apt.releases.hashicorp.com jammy/main amd64 Packages [86.1 kB] #0 1.283 Get:3 http://ports.ubuntu.com/ubuntu-ports jammy InRelease [270 kB] #0 2.154 Get:4 http://ports.ubuntu.com/ubuntu-ports jammy-updates InRelease [114 kB] #0 2.355 Get:5 http://ports.ubuntu.com/ubuntu-ports jammy-backports InRelease [99.8 kB] #0 2.558 Get:6 http://ports.ubuntu.com/ubuntu-ports jammy-security InRelease [110 kB] #0 2.763 Get:7 http://ports.ubuntu.com/ubuntu-ports jammy/main arm64 Packages [1758 kB] #0 3.424 Get:8 http://ports.ubuntu.com/ubuntu-ports jammy/restricted arm64 Packages [24.2 kB] #0 3.430 Get:9 http://ports.ubuntu.com/ubuntu-ports jammy/universe arm64 Packages [17.2 MB] #0 9.423 Get:10 http://ports.ubuntu.com/ubuntu-ports jammy/multiverse arm64 Packages [224 kB] #0 9.519 Get:11 http://ports.ubuntu.com/ubuntu-ports jammy-updates/multiverse arm64 [2022-11-04T23:47:53.372Z] Packages [11.0 kB] #0 9.523 Get:12 http://ports.ubuntu.com/ubuntu-ports jammy-updates/main arm64 Packages [819 kB] #0 9.878 Get:13 http://ports.ubuntu.com/ubuntu-ports jammy-updates/restricted arm64 Packages [197 kB] #0 9.968 Get:14 http://ports.ubuntu.com/ubuntu-ports jammy-updates/universe arm64 Packages [806 kB] #0 10.32 Get:15 http://ports.ubuntu.com/ubuntu-ports jammy-backports/main arm64 Packages [3184 B] #0 10.32 Get:16 http://ports.ubuntu.com/ubuntu-ports jammy-backports/universe arm64 Packages [7275 B] #0 10.32 Get:17 http://ports.ubuntu.com/ubuntu-ports jammy-security/restricted arm64 Packages [184 kB] #0 10.40 Get:18 http://ports.ubuntu.com/ubuntu-ports jammy-security/main arm64 Packages [524 kB] #0 10.61 Get:19 http://ports.ubuntu.com/ubuntu-ports jammy-security/universe arm64 Packages [624 kB] #0 10.95 Fetched 23.1 MB in 10s (2314 kB/s) #0 10.95 Reading package lists... #0 11.34 W: https://apt.releases.hashicorp.com/dists/jammy/InRelease: Key is stored in legacy trusted.gpg keyring (/ [2022-11-04T23:47:53.372Z] etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details. #0 11.35 Repository: 'deb [arch=amd64] https://apt.releases.hashicorp.com jammy main' #0 11.35 Description: #0 11.35 Archive for codename: jammy components: main #0 11.35 More info: https://apt.releases.hashicorp.com #0 11.35 Adding repository. #0 11.35 Adding deb entry to /etc/apt/sources.list.d/archive_uri-https_apt_releases_hashicorp_com-jammy.list #0 11.35 Adding disabled deb-src entry to /etc/apt/sources.list.d/archive_uri-https_apt_releases_hashicorp_com-jammy.list #0 11.51 Hit:1 https://apt.releases.hashicorp.com jammy InRelease #0 11.74 Hit:2 http://ports.ubuntu.com/ubuntu-ports jammy InRelease #0 11.92 Hit:3 http://ports.ubuntu.com/ubuntu-ports jammy-updates InRelease #0 12.09 Hit:4 http://ports.ubuntu.com/ubuntu-ports jammy-backports InRelease #0 12.26 Hit:5 http://ports.ubuntu.com/ubuntu-ports jammy-security InRelease #0 12.35 Reading package lists... #0 12.77 W: https://apt.releases.hashicorp.com/dists/jammy [2022-11-04T23:47:53.373Z] /InRelease: Key is stored in legacy trusted.gpg keyring (/etc/apt/trusted.gpg), see the DEPRECATION section in apt-key(8) for details. #0 13.26 E: Unable to locate package terraform #0 13.26 E: Unable to locate package terraform-ls ------ ERROR: failed to solve: executor failed running [/bin/sh -c curl -fsSL https://apt.releases.hashicorp.com/gpg | sudo apt-key add - && apt-add-repository "deb [arch=amd64] https://apt.releases.hashicorp.com $(lsb_release -cs) main" && apt-get update && sudo apt-get -qq install --no-install-recommends --yes terraform terraform-ls]: exit code: 100 [2022-11-04T23:47:53.379Z] Stop (13871 ms): Run: docker buildx build --load --build-arg BUILDKIT_INLINE_CACHE=1 -f /var/folders/sv/96yn3fts7y12pvs07fgrhfjc0000gr/T/devcontainercli/container-features/0.23.2-1667605659484/Dockerfile-with-features -t vsc-terraform-aws-eks-blueprints-956fe8076bbfc9aa1392f46920cb6728 --target dev_containers_target_stage --build-arg VARIANT=ubuntu-22.04 --build-arg GOMPLATE_VERSION=3.11.3 --build-arg TERRAFORM_DOCS_VERSION=0.16.0 --build-arg TFLINT_AWS_RULESET_VERSION=0.17.1 --build-arg TFSEC_VERSION=1.28.0 --build-arg TERRASCAN_VERSION=1.15.2 --build-arg _DEV_CONTAINERS_BASE_IMAGE=dev_container_auto_added_stage_label /Users/kuapoorv/blueprints/terraform-aws-eks-blueprints/.devcontainer [2022-11-04T23:47:53.381Z] Error: Command failed: docker buildx build --load --build-arg BUILDKIT_INLINE_CACHE=1 -f /var/folders/sv/96yn3fts7y12pvs07fgrhfjc0000gr/T/devcontainercli/container-features/0.23.2-1667605659484/Dockerfile-with-features -t vsc-terraform-aws-eks-blueprints-956fe8076bbfc9aa1392f46920cb6728 --target dev_containers_target_stage --build-arg VARIANT=ubuntu-22.04 --build-arg GOMPLATE_VERSION=3.11.3 --build-arg TERRAFORM_DOCS_VERSION=0.16.0 --build-arg TFLINT_AWS_RULESET_VERSION=0.17.1 --build-arg TFSEC_VERSION=1.28.0 --build-arg TERRASCAN_VERSION=1.15.2 --build-arg _DEV_CONTAINERS_BASE_IMAGE=dev_container_auto_added_stage_label /Users/kuapoorv/blueprints/terraform-aws-eks-blueprints/.devcontainer [2022-11-04T23:47:53.381Z] at doe (/Users/kuapoorv/.vscode/extensions/ms-vscode-remote.remote-containers-0.262.3/dist/spec-node/devContainersSpecCLI.js:1888:1635) [2022-11-04T23:47:53.381Z] at process.processTicksAndRejections (node:internal/process/task_queues:96:5) [2022-11-04T23:47:53.381Z] at async pF (/Users/kuapoorv/.vscode/extensions/ms-vscode-remote.remote-containers-0.262.3/dist/spec-node/devContainersSpecCLI.js:1887:1973) [2022-11-04T23:47:53.381Z] at async eT (/Users/kuapoorv/.vscode/extensions/ms-vscode-remote.remote-containers-0.262.3/dist/spec-node/devContainersSpecCLI.js:1887:901) [2022-11-04T23:47:53.381Z] at async voe (/Users/kuapoorv/.vscode/extensions/ms-vscode-remote.remote-containers-0.262.3/dist/spec-node/devContainersSpecCLI.js:1893:2049) [2022-11-04T23:47:53.382Z] at async Xf (/Users/kuapoorv/.vscode/extensions/ms-vscode-remote.remote-containers-0.262.3/dist/spec-node/devContainersSpecCLI.js:1893:3212) [2022-11-04T23:47:53.382Z] at async Jae (/Users/kuapoorv/.vscode/extensions/ms-vscode-remote.remote-containers-0.262.3/dist/spec-node/devContainersSpecCLI.js:2013:15058) [2022-11-04T23:47:53.382Z] at async Wae (/Users/kuapoorv/.vscode/extensions/ms-vscode-remote.remote-containers-0.262.3/dist/spec-node/devContainersSpecCLI.js:2013:14812) [2022-11-04T23:47:53.389Z] Stop (14937 ms): Run: /Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper.app/Contents/MacOS/Code Helper --ms-enable-electron-run-as-node /Users/kuapoorv/.vscode/extensions/ms-vscode-remote.remote-containers-0.262.3/dist/spec-node/devContainersSpecCLI.js up --user-data-folder /Users/kuapoorv/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-containers/data --workspace-folder /Users/kuapoorv/blueprints/terraform-aws-eks-blueprints --workspace-mount-consistency cached --id-label devcontainer.local_folder=/Users/kuapoorv/blueprints/terraform-aws-eks-blueprints --log-level debug --log-format json --config /Users/kuapoorv/blueprints/terraform-aws-eks-blueprints/.devcontainer/devcontainer.json --default-user-env-probe loginInteractiveShell --mount type=volume,source=vscode,target=/vscode,external=true --skip-post-create --update-remote-user-uid-default on --mount-workspace-git-root true [2022-11-04T23:47:53.389Z] Exit code 1 [2022-11-04T23:47:53.398Z] Command failed: /Applications/Visual Studio Code.app/Contents/Frameworks/Code Helper.app/Contents/MacOS/Code Helper --ms-enable-electron-run-as-node /Users/kuapoorv/.vscode/extensions/ms-vscode-remote.remote-containers-0.262.3/dist/spec-node/devContainersSpecCLI.js up --user-data-folder /Users/kuapoorv/Library/Application Support/Code/User/globalStorage/ms-vscode-remote.remote-containers/data --workspace-folder /Users/kuapoorv/blueprints/terraform-aws-eks-blueprints --workspace-mount-consistency cached --id-label devcontainer.local_folder=/Users/kuapoorv/blueprints/terraform-aws-eks-blueprints --log-level debug --log-format json --config /Users/kuapoorv/blueprints/terraform-aws-eks-blueprints/.devcontainer/devcontainer.json --default-user-env-probe loginInteractiveShell --mount type=volume,source=vscode,target=/vscode,external=true --skip-post-create --update-remote-user-uid-default on --mount-workspace-git-root true [2022-11-04T23:47:53.398Z] Exit code 1 ```
DavidS-ovm commented 1 year ago

Hi @askulkarni2 , can you have a look whether my PR at https://github.com/awslabs/aws-terraform-dev-container/pull/3 fixes your problem? I could build on my mac with it.

valter-silva-au commented 1 year ago

Hi @askulkarni2 , could you please try "VARIANT": "ubuntu-18.04" on .devcontainer/devcontainer.json and let me know if worked for you? Unfortunately I don't have a M1 to test it.

More info here: https://github.com/devcontainers/templates/tree/main/src/ubuntu

valter-silva-au commented 1 year ago

Closing this issue for now, please re-open if the issue still persist.