Azure / iotedgedev

The Azure IoT Edge Dev Tool greatly simplifies your Azure IoT Edge development process. It has everything you need to get started and helps with your day-to-day Edge development.
https://aka.ms/iotedgedev
Other
160 stars 71 forks source link

iotedgedev build not respecting buildOptions from modules.json #516

Closed anandchugh closed 2 years ago

anandchugh commented 2 years ago

Steps to Reproduce:

  1. Add buildOptions in modules.json
    {
    "$schema-version": "0.0.1",
    "description": "",
    "image": {
    "repository": "${ACR_ADDRESS}/imagename",
    "tag": {
      "version": "0.0.7.preview",
      "platforms": {
        "arm64v8": "./Dockerfile.arm64v8",
        "arm64v8.debug": "./Dockerfile.arm64v8.debug"
      }
    },
    "buildOptions": [
      "--build-arg BASE_IMAGE=${BASE_IMAGE}",
      "--target final"
    ],
    "contextPath": "./"
    },
    "language": "python"
    }
  2. Run following command iotedgedev build -f ./deployment.template.json -P arm64v8
  3. Docker build is not using the buildOptions specified in modules.json
  4. We also tried with VScode IotEdge extension(Azure IotEdge) and its working as expected.
MrVhek commented 2 years ago

I'm having the same problem trying to build an arm64v8 image on ubuntu using the command: iotedgedev build --file deployment.template.json --platform arm64v8 I keep having the message: [Warning] The requested image's platform (linux/arm64/v8) does not match the detected host platform (linux/amd64) and no specific platform was requested I've also tried adding "buildOptions": ["--platform linux/arm64/v8"] to my module.json but it doesn't change anything.

konichi3 commented 2 years ago

Thank you for the report. We have added this to our backlog for further investigation

mhshami01 commented 2 years ago

@anandchugh - In Iotedgedev, we use the docker client API to produce an image. The API is behaving differently than the docker cli build command, please see issue 2957. In VSCode, we use docker cli command, hence the difference in behavior.

mhshami01 commented 2 years ago

@MrVhek - You are reporting an unrelated issue. Please feel free to file a separate report. Include information about the platform used, version of Ubuntu, etc.

marianan commented 2 years ago

Closing this issue due to inactivity.