Install Subversion and WebSVN on Docker
Use Apache Subversion (SVN) and websvn Using Docker.
Apache Subversion (often abbreviated SVN, after its command name svn) is a software versioning and revision control system distributed as open source under the Apache License. Software developers useSubversion to maintain current and historical versions of files such as source code, web pages, and documentation.
This is very simple to use the Subversion Server on docker. You don’t need to learn linux and make many configuration for it.
I am going to show you the very easy way to use Subversion on Docker. I have build a Docker image for it. You just need to pull that image and start container. There are the few way to launch container.
I have shown the two easiest way to run docker container for Subversion.
Docker and Docker Compose.
Docker-: To install docker on your Linux machine (Ubuntu/CentOS/RedHat)
$ sudo yum install -y docker
$ sudo apt update $ sudo apt install -y docker.io
To start docker service.
$ sudo service docker start
DockerCompose-: To install docker-compose, Please make sure that curl package is installed.
$ sudo curl -L "https://github.com/docker/compose/releases/download/1.11.2/docker-compose-$(uname -s)-$(uname -m)" -o /usr/bin/docker-compose
Change the permission to executable.
$ sudo chmod +x /usr/bin/docker-compose
Finally, your machine is ready to run docker containers.
First method-: Run docker container as command. You need to run using below command.
$ docker run -d -p 80:80 -p 2222:22 -p 443:443 arvindr226/subversion
In the above command -p is used for port. If you want to change SVN port for your machine or available port, you can change as below:
$ docker run -d -p PORT:80 -p PORT:22 -p PORT:443 arvindr226/subversion
Second Method-: This method is very easy method for everyone. You just need to create a file named as docker-compose.yml. Paste the below content in the file.
version: "2.0" services: web: container_name: subversions image: arvindr226/subversion ports: - "80:80" - "443:443" - "2222:22"
Save and exit.
To start the docker container using below command.
$ docker-compose up -d
To stop the docker container.
$ docker-compose stop
How to create SVN Repository ?
First of all generate ssh public key using below command.
Step 1-: Authenticate your localhost to docker container
$ ssh-copy-id [email protected] -p2222
Enter the password “gotechnies”
Step 2-: Create SVN repository.
$ ssh [email protected] -p2222 /create_svn.sh New_Repo
Step 3-: Checkout your SVN repository
$ svn co http://192.168.1.89/svn/New_Repo
Default Username and password.