Issue in taking the build of an docker image using azure-storage-blob package in arm32v7 architecture

When attempting to build a Dockerfile targeting the arm32v7 architecture, a peculiar error related to gcc arises. Specifically, the error message “unable to execute ‘gcc’: No such file or directory” emerges during the inclusion of the azure-storage-blob package version 12.6.0 in the requirements file. Surprisingly, excluding this package resolves the issue, enabling the Dockerfile to proceed without hindrance. Notably, other specified packages such as azure-iot-device, pytz, sympy, and python-dateutil remain unaffected by this adjustment. Here are the package versions specified in the requirements file: azure-storage-blob: 12.6.0 azure-iot-device: ~=2.7.0 pytz: 2023.3.post1 sympy: 1.10.1 python-dateutil: 2.8.2 Below is the Dockerfile (Dockerfile.arm32v7) snippet where the error occurs:dockerfile.txt Please provide help to solve this problem

DockerFile:

Use the official Python image for ARM32v7 as the base image

FROM arm32v7/python:3.7-slim-buster

Set the working directory in the container

WORKDIR /app

Install build-essential package

RUN apt-get update && apt-get install -y build-essential

Copy the Python application code and requirements.txt into the container

COPY requirements.txt /app/
COPY . .

Run

RUN pip install --no-cache-dir -r requirements.txt

Command to run the application

CMD [ “python3”, “-u”, “./main.py” ]

1 Like

Hello.

Like the image name, the slim-buster seems to be caused because it contains only minimal packages.

If we add the following command, we think successful build will be possible while using the arm32v7/python:3.7-slim-buster image.

RUN apt-get update && \ apt-get install -y build-essential && \ gcc --version

Additionally, it is good to use an image such as arm32v7/python:3.7-buster instead of a slim image.

best regards.
limsangwoons.

Hello,
Tried with suggested changes. Now we are facing a problem like apt-get not found .I am hereby copying the error

10.16 Reading package lists…

14.80 /bin/sh: 1: apt-get: not found

Dockerfile:6

4 WORKDIR /app

RUN apt install apt

6 | >>> RUN apt-get update && apt-get install -y build-essential && gcc-version

7 #Copy the Python application code and requirements.txt into the container

ERROR: failed to solve: process */bin/sh -c apt-get update && \ apt-get install -y build-essential && \ gcc --version did not complete successfully: exit code

Hello.

I think it would be better to use yum for your image

RUN yum update -y && \ yum groupinstall -y "Development Tools" && \ yum install -y gcc-c++ && \ gcc --version

Sorry for the late response!!

Hello,
Tried out RUN yum update -y && \ yum groupinstall -y “Development Tools” && \ yum install -y gcc-c++ && \ gcc --version but not working getting error.
#7 [3/6] RUN yum update -y && yum groupinstall -y “Development Tools” && yum install -y gcc-c++ && gcc --version
#7 0.874 /bin/sh: 1: yum: not found
#7 ERROR: process “/bin/sh -c yum update -y && \ yum groupinstall -y "Development Tools" && \ yum install -y gcc-c++ && \ gcc --version” did not complete successfully: exit code: 127
Later we changed the Dockerfile .This is working as expected

Use the official Alpine-based Python image for ARM32v7 as the base image

FROM arm32v7/python:3.7-alpine

Set the working directory in the container

WORKDIR /app

Install required packages

RUN apk add --no-cache gcc musl-dev libffi-dev openssl-dev cargo

Copy the Python application code and requirements.txt into the container

COPY requirements.txt /app/
COPY . .

Upgrade pip

RUN pip install --no-cache-dir --upgrade pip

Install Python dependencies

RUN pip install --no-cache-dir -r requirements.txt

Command to run the application

CMD [ “python3”, “-u”, “./main.py” ]

That’s a relief!

Congratulations on changing the base image.