Creating a linux environment with docker

Suppose you have some binaries built for Ubuntu / Fedora etc… and you wanted to run them on your OS.

Create folder with binaries and dockerfile

mkdir temp
cp your-binaries temp
cd temp

Create dockerfile

Create dockerfile, declaring dependencies you need

echo "FROM fedora:34\n\
RUN dnf install -y cmake make gcc-c++" > Dockerfile

Create docker image

docker build -t temp .

Run it

docker run -it --name temp --mount type=bind,source=$PWD,target=/app /bin/bash