Closed4

yum: command not found

philosophynotephilosophynote

次のDockerfileを作成し、buildできることを確認したので
commitした

FROM umihico/aws-lambda-selenium-python:latest
RUN yum -y install libgomp 
COPY ./requirements.txt /opt/
RUN pip install --upgrade pip && pip install --no-cache-dir -r /opt/requirements.txt 
COPY . ./
CMD [ "main.handler" ]
philosophynotephilosophynote

しばらく経過した後、
プロフラムファイルで修正箇所が発生したため
再度buildしたところ、
次のエラーが発生した

 > [2/5] RUN yum -y install libgomp:
1.183 /bin/sh: line 1: yum: command not found
------
Dockerfile:2
--------------------
   1 |     FROM umihico/aws-lambda-selenium-python:latest
   2 | >>> RUN yum -y install libgomp
   3 |     COPY ./requirements.txt /opt/
   4 |     RUN pip install --upgrade pip && pip install --no-cache-dir -r /opt/requirements.txt
--------------------
ERROR: failed to solve: process "/bin/sh -c yum -y install libgomp" did not complete successfully: exit code: 127
philosophynotephilosophynote

キャッシュなどを疑ったが、--no-cacheオプションをつけても解消されなかったため、
途方に暮れたが、
最終的に元となるイメージのGithubを参照したところ、
自分がcommitした後にyumからdnfへの切り替えが実行されており、
これが原因であった。

https://github.com/umihico/docker-selenium-lambda/pull/208

philosophynotephilosophynote

そのためDockerfileを次のように修正し、
ビルドし直して解消した

FROM umihico/aws-lambda-selenium-python:latest
RUN dnf -y install libgomp 
COPY ./requirements.txt /opt/
RUN pip install --upgrade pip && pip install --no-cache-dir -r /opt/requirements.txt 
COPY . ./
CMD [ "main.handler" ]
このスクラップは2025/02/25にクローズされました