Need help with Dockerfile that builds software in debian environment

Hi there,
I have a program that requires to be built on debian because of package requirements. However, most CI services don’t support debian as a build environment, only ubuntu. Could anyone help me with a dockerfile that runs the following commands inside a debian container. They will be in the same directory as the dockerfile.

chmod u+x build.sh
./build.sh

Thanks

hey you can copy the file in docker file and run the sh script
like below

# debian image
FROM debian

WORKDIR /

USER root

COPY build.sh /
# install dependencies require to run you build.sh

RUN chmod +x /build.sh

RUN /build.sh

# further more code
...

When running this, I get the error: E: Invalid operation update when running apt-get update

hey
i am not getting any error on apt-get update command.
can you please provide full error message and also check there is any syntax or typo error.

Never mind. I just realized that it was because I was saving it with Windows line endings instead of unix line endings.

When the script runs cdebootstrap, it works for a while and then says E: Failed to unshare: Operation not permitted