admin管理员组文章数量:1123195
I have below dockerfile
FROM mcr.microsoft/dotnet/runtime:8.0 AS base
RUN apt-get update
RUN apt-get install -y libmotif-dev build-essential
COPY . /usr/src/myapp
COPY oracle-outside-in-content-access-8.5.7.0.0-linux-x86-64/redist /usr/src/myapp/oracle-outside-in-content-access-8.5.7.0.0-linux-x86-64/sdk/demo
WORKDIR /usr/src/myapp/oracle-outside-in-content-access-8.5.7.0.0-linux-x86-64/sdk/samplecode/unix/
RUN make
WORKDIR /app
RUN adduser -u 5678 --disabled-password --gecos "" appuser && chown -R appuser /app
USER appuser
COPY . .
For reference, locally I have following files in directory oracle-outside-in-content-access-8.5.7.0.0-linux-x86-64/sdk/samplecode/unix/
below is makefile
all: casample taredir textdemo extract_archive extract_object memoryio parsepst batch_process_ca
.PHONY: all
taredir:
@TARGET="taredir" \
MAYBE_XPRINTER="" \
TARGETDEPS="-lsc_da -lsc_ta -lsc_lo " \
./configure
textdemo:
@TARGET="textdemo" \
MAYBE_XPRINTER="" \
TARGETDEPS="-lsc_da -lsc_ta -lsc_lo -lXm -lXt -lX11" \
./configure
casample:
@TARGET="casample" \
TARGETDEPS="-lsc_da -lsc_ca -DUNIX" \
./configure
extract_archive:
@TARGET="extract_archive" \
TARGETDEPS="-lsc_da" \
./configure
extract_object:
@TARGET="extract_object" \
TARGETDEPS="-lsc_da -lsc_ca" \
./configure
memoryio:
@TARGET="memoryio" \
TARGETDEPS="-lsc_da -lsc_ca" \
./configure
parsepst:
@TARGET="parsepst" \
TARGETDEPS="-lsc_da -lsc_ca" \
./configure
batch_process_ca:
@TARGET="batch_process_ca" \
TARGETDEPS="-lsc_ca -lsc_da -DUNIX" \
./configure
and one configure
file (content of that may not be relevant for this question) on same path.
When I run docker build -t myapp-oracle-extract .
I get below error.
=> [base 7/11] WORKDIR /usr/src/myapp/oracle-outside-in-content-access-8.5.7.0.0-linux-x86-64/sdk/samplecode/unix/ 1.0s
=> ERROR [base 8/11] RUN make 1.9s
------
> [base 8/11] RUN make:
1.149 /bin/sh: 1: ./configure: not found
1.149 make: *** [makefile:32: casample] Error 127
------
Dockerfile:46
--------------------
44 | WORKDIR /usr/src/myapp/oracle-outside-in-content-access-8.5.7.0.0-linux-x86-64/sdk/samplecode/unix/
45 | # This command compiles your app using GCC, adjust for your source code
46 | >>> RUN make
47 |
48 | WORKDIR /app
--------------------
ERROR: failed to solve: process "/bin/sh -c make" did not complete successfully: exit code: 2
Why it is unable to find ./configure
even thought it has been copied. Does it run from different context? Why makefile
is found but not configure
file
I have below dockerfile
FROM mcr.microsoft.com/dotnet/runtime:8.0 AS base
RUN apt-get update
RUN apt-get install -y libmotif-dev build-essential
COPY . /usr/src/myapp
COPY oracle-outside-in-content-access-8.5.7.0.0-linux-x86-64/redist /usr/src/myapp/oracle-outside-in-content-access-8.5.7.0.0-linux-x86-64/sdk/demo
WORKDIR /usr/src/myapp/oracle-outside-in-content-access-8.5.7.0.0-linux-x86-64/sdk/samplecode/unix/
RUN make
WORKDIR /app
RUN adduser -u 5678 --disabled-password --gecos "" appuser && chown -R appuser /app
USER appuser
COPY . .
For reference, locally I have following files in directory oracle-outside-in-content-access-8.5.7.0.0-linux-x86-64/sdk/samplecode/unix/
below is makefile
all: casample taredir textdemo extract_archive extract_object memoryio parsepst batch_process_ca
.PHONY: all
taredir:
@TARGET="taredir" \
MAYBE_XPRINTER="" \
TARGETDEPS="-lsc_da -lsc_ta -lsc_lo " \
./configure
textdemo:
@TARGET="textdemo" \
MAYBE_XPRINTER="" \
TARGETDEPS="-lsc_da -lsc_ta -lsc_lo -lXm -lXt -lX11" \
./configure
casample:
@TARGET="casample" \
TARGETDEPS="-lsc_da -lsc_ca -DUNIX" \
./configure
extract_archive:
@TARGET="extract_archive" \
TARGETDEPS="-lsc_da" \
./configure
extract_object:
@TARGET="extract_object" \
TARGETDEPS="-lsc_da -lsc_ca" \
./configure
memoryio:
@TARGET="memoryio" \
TARGETDEPS="-lsc_da -lsc_ca" \
./configure
parsepst:
@TARGET="parsepst" \
TARGETDEPS="-lsc_da -lsc_ca" \
./configure
batch_process_ca:
@TARGET="batch_process_ca" \
TARGETDEPS="-lsc_ca -lsc_da -DUNIX" \
./configure
and one configure
file (content of that may not be relevant for this question) on same path.
When I run docker build -t myapp-oracle-extract .
I get below error.
=> [base 7/11] WORKDIR /usr/src/myapp/oracle-outside-in-content-access-8.5.7.0.0-linux-x86-64/sdk/samplecode/unix/ 1.0s
=> ERROR [base 8/11] RUN make 1.9s
------
> [base 8/11] RUN make:
1.149 /bin/sh: 1: ./configure: not found
1.149 make: *** [makefile:32: casample] Error 127
------
Dockerfile:46
--------------------
44 | WORKDIR /usr/src/myapp/oracle-outside-in-content-access-8.5.7.0.0-linux-x86-64/sdk/samplecode/unix/
45 | # This command compiles your app using GCC, adjust for your source code
46 | >>> RUN make
47 |
48 | WORKDIR /app
--------------------
ERROR: failed to solve: process "/bin/sh -c make" did not complete successfully: exit code: 2
Why it is unable to find ./configure
even thought it has been copied. Does it run from different context? Why makefile
is found but not configure
file
1 Answer
Reset to default 0File Permissions Issue:
1: In the Docker build context, the files you copy into the container retain their permissions unless explicitly changed.
2: If the configure file does not have execute (+x) permissions locally, it will not be executable in the container.
Updated Dockerfile:
FROM mcr.microsoft.com/dotnet/runtime:8.0 AS base
RUN apt-get update RUN apt-get install -y libmotif-dev build-essential
COPY . /usr/src/myapp
WORKDIR /usr/src/myapp/oracle-outside-in-content-access-8.5.7.0.0-linux-x86-64/sdk/samplecode/unix/
RUN chmod +x ./configure
RUN ls -l
RUN make
WORKDIR /app
RUN adduser -u 5678 --disabled-password --gecos "" appuser && chown -R
appuser /app
USER appuser
COPY . .
本文标签: netMakefile unable to find configure inside dockerStack Overflow
版权声明:本文标题:.net - Makefile unable to find .configure inside docker - Stack Overflow 内容由网友自发贡献,该文观点仅代表作者本人, 转载请联系作者并注明出处:http://www.betaflare.com/web/1736555999a1944578.html, 本站仅提供信息存储空间服务,不拥有所有权,不承担相关法律责任。如发现本站有涉嫌抄袭侵权/违法违规的内容,一经查实,本站将立刻删除。
pwd
to show the current directory andls
to show what's in the directory before it tries to run./configure
. That should give you some hints. – MadScientist Commented 8 hours ago./configure
script is executable and that the interpreter on the first line of the script (e.g.,#!/bin/sh
typically) exists (that is,/bin/sh
exists). Sometimes you get slightly confusing errors when you try to run an interpreted script but the interpreter can't be found or fails for some reason. – MadScientist Commented 8 hours agoconfigure
script has DOS line endings, which could cause this issue in a Linux container? – David Maze Commented 7 hours agocasample
. Do you have the same problem if youRUN ./configure
, without the Make wrapper?) – David Maze Commented 7 hours agoRUN ./configure
– Anonymous Creator Commented 7 hours ago