1

I am trying to cargo build Azure IoT edge security daemon code (edgelet) in a docker. This goes smoothly on my Ubuntu machine. However, an issue occurs when I try to compile in Docker.

Here is the issue:

 Compiling k8s-openapi v0.4.0
 error: inclusive range syntax is experimental (see issue #28237)
 --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/k8s-openapi-0.4.0/build.rs:10:19
 |
 10 |         for v2 in MIN..=MAX {
 |                   ^^^^^^^^^

 error: inclusive range syntax is experimental (see issue #28237)
 --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/k8s-openapi-0.4.0/build.rs:32:14
 |
 32 |     for v in MIN..=MAX {
 |              ^^^^^^^^^

 error: inclusive range syntax is experimental (see issue #28237)
 --> /root/.cargo/registry/src/github.com-1ecc6299db9ec823/k8s- 
 openapi-0.4.0/build.rs:117:14
|
117 |     for v in MIN..=MAX {
|              ^^^^^^^^^

error: aborting due to 3 previous errors

error: Could not compile `k8s-openapi`.

Here is a portion of my Docker file:

RUN apt-get update  && \
apt-get install -y --no-install-recommends --allow-unauthenticated\
 curl\
 cargo
WORKDIR /usr/app
RUN curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- -y
COPY edgelet .
RUN cargo build
jcroskery
  • 135
  • 2
  • 10
Chirag Dhyani
  • 863
  • 11
  • 24

1 Answers1

0

Please check rustc's version which used in your docker image and version of the compiler on your Ubuntu machine.

The only possible reason for that behavior is you have old version of rustc in your docker image.

MaxV
  • 2,601
  • 3
  • 18
  • 25