Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

error: InvalidExe on execution when building from source #22

Open
MathieuB1 opened this issue Jun 21, 2024 · 0 comments
Open

error: InvalidExe on execution when building from source #22

MathieuB1 opened this issue Jun 21, 2024 · 0 comments

Comments

@MathieuB1
Copy link

Hi everyone,

I tried the following in a Dockerfile:

FROM ubuntu:20.04

ENV DEBIAN_FRONTEND=noninteractive
ENV ARCH=x86_64


## Compiling Dockerc works but error on execution: InvalidExe

# Install dockerc from Git
RUN apt update && apt install -y wget xz-utils git autoconf automake libtool libzstd-dev make libapr1-dev gnulib python3 gcc build-essential libsystemd-dev libprotobuf-c-dev libcap-dev libseccomp-dev libyajl-dev go-md2man libgpgme-dev libassuan-dev libbtrfs-dev libdevmapper-dev pkg-config golang-github-opencontainers-selinux-dev libpkgconf3 && \
apt-get autoremove && \
apt-get clean && \
rm -rf /var/lib/apt/lists/* /usr/share/doc /usr/share/man /usr/share/info

# Install GO
RUN wget https://go.dev/dl/go1.22.4.linux-amd64.tar.gz && \
    rm -rf /usr/local/go && tar -C /usr/local -xzf go1.22.4.linux-amd64.tar.gz && rm -rf go1.22.4.linux-amd64.tar.gz

ENV PATH=$PATH:/usr/local/go/bin

# Install Zig
RUN wget https://ziglang.org/download/0.13.0/zig-linux-x86_64-0.13.0.tar.xz && \
tar -xf zig-linux-x86_64-0.13.0.tar.xz && \
cp zig-linux-x86_64-0.13.0/zig /usr/local/bin/ && \
cp -r zig-linux-x86_64-0.13.0/lib/* /usr/lib/ && rm -rf zig-linux-x86_64-0.13.0.tar.xz

WORKDIR /usr/src/

# Apply the patch
RUN mkdir -p dockerctmp && cd dockerctmp && \
    git clone --recursive https://github.com/NilsIrl/dockerc.git

RUN cd dockerctmp/dockerc/crun/ && zig build -Doptimize=ReleaseSafe -Dtarget=x86_64-linux-gnu && chmod +x zig-out/bin/dockerc && mv zig-out/bin/dockerc /usr/src/

docker build -t myapp .
docker run -it --rm  -v "${PWD}:/usr/app/" myapp bash

When running I have this output:

./dockerc --image docker-archive:/usr/app/dockercontainersavedimage.tar  -o test

Getting image source signatures
Copying blob sha256:3ec3ded77c0ce89e931f92aed086b2a2c774a6fbd51617853decc8afa4e1087a
Copying blob sha256:6ba3d9d08319a20618d2c6440b686e28e35fdc30146b6a50a66f964667561e25
Copying blob sha256:d269513b9138f5714c72faf415390f72e394bdfec5cc9c3aa81861d09885b886
Copying blob sha256:6ba3d9d08319a20618d2c6440b686e28e35fdc30146b6a50a66f964667561e25
Copying blob sha256:04b0d88aac0a2a5963294f298f04ee6da0c6e46d9eff327161655b4c2a9844a8
Copying config sha256:90fd206e4a0415ca5ee6416db3eb167da951ce349015b1a6f923afe6a07a3da6
Writing manifest to image destination
error: InvalidExe

But with the https://github.com/NilsIrl/dockerc/releases/download/v0.2.1/dockerc its working fine. Can you please advise?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant