Photo by Kevin Horvat
All 12 years of my career, I have been working with .NET and have been strongly attached to Windows and proprietary development tools. But, thanks to Microsoft, .NET Core has changed everything and now you can develop for .NET on almost anything and in anything. The point is small - drag your projects onto Core. Not so long ago, I decided this question and started a tractor for a full move to Ubuntu.
I really liked the result - everything took off, it’s easy to develop, and Docker and Kubernetes made the process of moving much easier. But due to poor knowledge of the OS, bash and the confusion of the installation options for some tools (for example, the same Docker), the initial setup took more than a day. That is, the process is quite long and in some places confusing.
In order to save time for the future myself and for those who also plan to try development for Linux, I designed everything in the form of scripts . You can run them on pure Ubuntu and they will set everything up while you are sitting and drinking seagulls. Also, if desired, they are easy to finish to fit your needs.
If this sounds useful to you, welcome to Cat.
Scripts are available in the repository on Github . An initial introduction to bash is enough to read them, and they are richly referenced. And a sophisticated person will most likely find non-optimal moments in them (if they are found, let me know, please, I will be very grateful to you).
Assuming that scripts will more often be “tuned” for specific needs than used in their original form, all the subtle points (for example, how to run a command from under the current user while in sudo mode) are also provided with links.
The final set consists of only five files - three scripts and two config files for kubernetes.
1_opinionated.sh
Sorry, but the first script is the main candidate for “finishing”, or even a pass.
First of all, he installs a hypervisor for the further launch of kubernetes. I chose Virtualbox, but it is also possible to run on KVM and generally without a hypervisor . Each option has its own nuances, so the final choice is yours.
The script also installs support for the Russian language (so that I can write this article).
After starting, you must reboot so that Virtualbox can configure itself before installing the rest of the tools.
2_setup.sh
The biggest and most useful script. He installs the following tools:
- Git
- .NET Core 3.1 SDK
- Nodejs
- Docker Community Edition, adds repository for Docker updates
- Verifies that Virtualbox or KVM is installed and installs minikube
- Installs Visual Studio Code and several extensions for developing both frontend and backend: Gitlens , TSLint , Prettier , Stylelint , C # , Docker tools , Kubernetes tools , Kubernetes Support .
3_configure.sh
Performs the setup of installed tools. Namely:
- Requests Git username and email
- Opposite suggests installing VS Code as the default editor for Git
- Optionally suggests using libsecret to save Git passwords in encrypted form
- Adds the current user to the docker group needed to work with Docker without using sudo all the time.
- Minikube starts and installs a dashboard to access the cluster through the Web UI
- Creates an admin user in minikube to access the dashboard. To do this, use the minikube_admin_user.yaml and minikube_role_binding.yaml files from the repository.
- Displays instructions for obtaining a token for access to the dashboard.
To apply docker access settings, you need to log out and restart the docker service. Or simply restart the OS.
That, in fact, is all. I hope the scripts will be useful for those who want to quickly get comfortable with Ubuntu and development for .NET Core.