Do you have a Redmine environment that you can use as you like?
Redmine cannot operate all functions and settings unless you have system administrator privileges. Also, in an environment with other users, it is not possible to change the settings as you like.
However, since Redmine is a server application, it requires some knowledge and effort to set it up. Also, many server applications, including Redmine, take more effort than Linux when trying to build on Windows. I think Linux is familiar to many IT engineers, but considering that Redmine is widely used by non-engineers, some people who want to use Redmine freely say "Linux". I imagine that there are many people who say "I don't understand" or "I only have a Windows PC at hand".
Therefore, in this article, I will explain the procedure for building a Linux environment using WSL2 (Windows Subsystem For Linux 2) on your Windows PC and building Redmine using Docker with less effort.
In this article, I will omit the explanation of WSL2 and Docker. (Although the explanation may be troublesome if it is confused ...) If the explanation of WSL2 and Docker is taken seriously, it will be a considerable amount. In this article, I hope that he will know that Redmine can be built easily and that everyone will feel free to try it, so I will proceed without touching on the theoretical part. I think that once you have an environment that actually works, you will feel like learning from it, so it would be better for him to study WSL2 and Docker from there. I think.
In addition, the content explained in this article is the information at the time of writing. Please be aware that the technology related to WSL2 and Docker is being updated rapidly, and this article may become obsolete soon. If the actual situation is different from this article, please refer to the primary information.
WSL2 requires a relatively new version of Windows 10 to work. Previously 2004 was required, but now it works with 1903/1909 as well. Also, previously it was only compatible with Windows 10 Pro, but now it is also available on Windows 10 Home.
WSL2 and Docker will work even if you don't have a lot of CPU or memory. However, the size of the Docker image is rather large, so it is better to reserve free disk space. (The image of Redmine handled this time alone has more than 500MB)
The steps required to build are the following three steps.
See the Windows Subsystem for Linux Installation Guide for Windows 10 (https://docs.microsoft.com/ja-jp/windows/wsl/install-win10).
Since PowerShell commands are used in the procedure, it may seem a little hurdle for those who are not familiar with it, but you do not have to worry because you only need to execute the following commands in order.
wsl --install
. (Currently only available for developers)dism.exe /online /enable-feature /featurename:Microsoft-Windows-Subsystem-Linux /all /norestart
dism.exe /online /enable-feature /featurename:VirtualMachinePlatform /all /norestart
wsl --set-default-version 2
Once this is done, all you have to do is install Linux. This time I will choose Ubuntu 20.04 LTS. This is the distribution of choice when running Docker.
See the "Installing Docker Desktop" chapter in "Overview of Docker Remote Containers in WSL 2" (https://docs.microsoft.com/ja-jp/windows/wsl/tutorials/wsl-containers). Beyond that, there's information for developers, but you can skip it all.
All you have to do is install Docker Desktop and change some settings.
It's a breather when you come here. It's a big deal, so let's try his Red Mica 1.2, which was just released the other day.
Start Ubuntu installed earlier and execute the following command, and it's OK.
sudo docker run -d -p 8000:3000 --name some-redmica redmica/redmica
If you go to http: // localhost: 8000
, you will see Redmine. The initial user/password is both admin
.
It ’s easy, is n’t it?
From here onward, please try various things while referring to the "Guide for System Administrators" in the Redmine Guide.
By default, Docker commands can only be executed by a superuser with root privileges (which in Windows is like administrator privileges). Ubuntu uses the command sudo
to temporarily execute commands with superuser privileges.
By the way, the Docker command can be executed by the currently logged-in user. After running the following command, you can run the Docker command without sudo
by logging back in to Ubuntu.
sudo usermod -aG docker (username created during Ubuntu setup)
For example, if the user name you created when setting up Ubuntu was alice
, the actual command to execute would be:
sudo usermod -aG docker alice
The above steps are the minimum steps to start a Redmine container. In order to use it in earnest, it is necessary to make settings for persisting database information. For details on how to use it, refer to redmica/redmica on Docker Hub. It may be hard at first because you don't know what you're writing, but as you get used to Docker, you'll understand it.
Also, if you do not understand the nature of the Dokcer container correctly, you may have troubles such as losing the data that you intended to be persistent. However, it's not scary at all, and if you understand it correctly, it doesn't matter. It means that you may be in danger if you proceed without knowing it. It's a good idea to look into Dokcer containers and volumes around here. If you have any questions, you can ask me directly on Twitter etc.
I am making something called My favorite Redmine execution environment using Docker Compose. It also works on Ubuntu with WSL2 installed this time, so if you are interested, please try it.
With WSL2 and Docker, you can easily build Redmine. Not only Redmine but also many server applications can be easily built using Docker. It may be a good idea to use this as an opportunity to acquire Docker knowledge and improve your skills.
And I hope you all have a comfortable Redmine life.
Recommended Posts