C++ develop container (Docker)

Docker file

FROM debian:latest

# Set non-interactive mode to avoid prompts during installation
ENV DEBIAN_FRONTEND=noninteractive

# Install necessary packages
RUN apt-get update && apt-get install -y g++ gdb cmake make git

# Set working directory
WORKDIR /workspace

# Default command to keep the container running
CMD ["/bin/bash"]

Docker image

$ docker buildx build -t "cpp-dev" -f "cpp_dev.dockerfile" .
$ docker run -it --rm -v $(pwd):/workspace cpp-dev