After setting up the Mac terminal, I tried developing the programs I had previously worked on in Ubuntu. However, I encountered an issue where Bun was unable to install packages properly after its installation. I have been stuck on this problem for the entire day and cannot find a solution.
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 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.
To build a docker image, run the following command:
Then run docker image to create an container.