0

i'm using Github's codespaces to spin up a dev container with vscode using docker-compose and a custom dockerfile that extends their prebuilt dev containers

My dockerfile


ARG VARIANT="8.0"
# Stage 2: Run the application using Microsoft PHP image
FROM mcr.microsoft.com/devcontainers/php:1-${VARIANT}

and my docker-compse.yml has


    services:
      app:
        build:
          context: .
          dockerfile: Dockerfile
          args:
            VARIANT: "8.0-bullseye"

However when i tried to spin it up the build is failing with the below error

2023-08-03 00:54:55.697Z: $1- 2023-08-03 00:54:55.726Z: Stop: Run: docker inspect --type image mcr.microsoft.com/devcontainers/php:1- 2023-08-03 00:54:55.904Z: Error fetching image details: No manifest found for mcr.microsoft.com/devcontainers/php:1-. 2023-08-03 00:54:55.910Z: $1- 2023-08-03 00:54:56.089Z: Error response from daemon: manifest for mcr.microsoft.com/devcontainers/php:1- not found: manifest unknown: manifest tagged by "1-" is not found 2023-08-03 00:54:56.111Z: Stop: Run: docker pull mcr.microsoft.com/devcontainers/php:1- 2023-08-03 00:54:56.117Z: {"outcome":"error","message":"Command failed: docker inspect --type image mcr.microsoft.com/devcontainers/php:1-","description":"An error occurred setting up the container."} 2023-08-03 00:54:56.121Z: devcontainer process exited with exit code 1

it seems that the tag "1-" should be 1-8.0-bullseye so it is incompleted because its not picking up the env variable. How can I set the env variable in the build context?

I tried setting the relevant env properties in the .devcontainer.json but still fails

Kendall
  • 5,065
  • 10
  • 45
  • 70

0 Answers0