mAcos pr docker ke saTH ubuntu development enviroment set krna

mAc terminal settiNg krne ke baD, meine un programs ko viksiT krne ka pryas kiya zin pr meine pHle ubuntu me kam kiya Tha. Halaki, muzhe ek smsya ka samna krna pda zHa bun Apni installation ke baD packages ko thik se install krne me AsmrTh Tha. mei pure Din is smsya me fsa rHa Hu or koi solution nHi find kr pa rHa Hu.
Thus, I gave up to set up development environment on MacOS directly and attempted to create a Ubuntu development environment, as same as previous Ubuntu development environment, on my Macbook.
Using Docker to set up an Ubuntu development environment on a Mac has several advantages compared to setting up the environment directly on the Mac:
Install Docker, drag and drop it in Applications
.
Check if Docker could work well.
docker -v
Docker version 27.0.3, build 7d4bcd8
Docker can build images automatically by reading the instructions from a Dockerfile. A Dockerfile is a text document that contains all the commands a user could call on the command line to assemble an image.
I make a Dockerfile with the commands to build an images with development environment as same as my previous Ubuntu.
# Use the latest Ubuntu image
FROM ubuntu:latest
# Update and install dependencies
RUN apt-get update && \
apt-get install -y curl git
# Install Bun
RUN curl -fsSL https://bun.sh/install | bash
To build a docker image, run the following command:
docker build -t ubuntu_on_mac .
Then run docker image to create an container.
docker run -itd -p 3000:3000 -v $HOME/ubuntu:/home --name ubuntu ubuntu_on_mac