Reputation: 61
To test podman I tried to create a minimal image "hello container". In my src directory, I have a Dockerfile and a main.cpp. the main.cpp :
#include <iostream>
int main(int argc, char ** argv)
{
std::cout << "Hello container" << std::endl;
}
The Dockerfile :
FROM gcc:6.3 AS build
COPY . /usr/src/testCpp
WORKDIR /usr/src/testCpp
RUN g++ -o simpleapp2 main.cpp
FROM alpine:latest
RUN apk update && apk add --no-cache libstdc++
WORKDIR /usr/bin/testCpp
COPY --from=0 /usr/src/testCpp/simpleapp2 .
# Run the output program from the previous step
CMD ["./simpleapp2"]
I get an image, but when i'm attempting to execute the imagewith the command "podman run 6c7cdfe0f023", I get the error message "standard_init_linux.go:228: exec user process caused: no such file or directory"?
My OS is RH 7.5, buuildah version is 1.11.6, and podman version is 1.6.4. When I inspect the directory $HOME/.local/share/containers/storage/overlay/, I can see a simpleapp2 file in diff/usr/bin/testCpp/.
Thanks for your help.
Upvotes: 0
Views: 597
Reputation: 61
The reason why my application was not running, is just because the alpine image does not contain all the libraries my application needed. just by replacing alpine by centos or debian, the execution is successful. I have now to find a way to get the logs :)
regards,
Upvotes: 1