Docker Community Forums

Share and learn in the Docker community.

Need help with Dockerfile that builds software in debian environment

docker
build
#1

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

(Nitishmowall) #2

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
...
#3

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

(Nitishmowall) #4

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.

#5

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

#6

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