/ Tech

Updating your rippled Docker Container

Wietse Wind

Wietse Wind

♥ Software, programming (nodejs, php, bash, ...), entrepreneurship, parrots and of course XRP (the XRPL) 🎉

Read More

If you operate a validator or rippled Docker Container (howto) the upgrade process is pretty easy. I intend to update the Docker Hub container images to the most recent rippled version ASAP, so all you have to do is re-create your container based on the newest image.

If you used the Github repositories (docker-rippled, docker-rippled-validator) there are instructions at the end of this article.

Docker Hub

If you just followed the instructions in the Howto and created a container, the old container image was fetched from the Docker Hub automatically. By now, the same image containing a newer version of rippled is waiting for you at the Docker Hub.

The steps below assume we are talking about the validator container, rippledvalidator — if you are running the rippled image instead of the rippledvalidator, please replace rippledvalidator in all the commands below for rippled.

If you named your container differently (my howto assumed the --name of the container to be either rippledvalidator or rippled, you can check your container name with the command:

docker ps -a

The last column will show your container nameThe last column will show your container name

1. Check the file mounts of our existing docker container (the -v argument)

When you created the container, you probably used a command containing a folder mapping (from the host to the docker container). This is where your rippled config and keys are stored. We are going to remove the container, and when we re-create our container (step 6) we want to use our existing config and keys. To be sure, we are going to check the path(s) mapped to the container:

docker inspect -f '{{ .Mounts }}' rippledvalidator

The mapped folders (mounts) are displayedThe mapped folders (mounts) are displayed

Looks like (in my case) I specified the path below using the -v option:

-v /Users/wrw/Desktop/Ripple/Docker/validator/keystore:/keystore

2. Check the mapped ports of our existing docker container (the -p argument)

Let’s check the mapped ports (from our Docker host to the container):

docker ps -a

In this case we see ...:51235->51235 in the output (for our rippledvalidator container)

Looks like I specified a portmap using the -p option:

-p 51235:51235

3. Stop the existing container

Now we know the -v and the -p argument(s) we have to use when we are going to re-create our docker container (step 6), we can stop our container:

docker stop rippledvalidator

Stopping the container will take 10~60 seconds; rippled wil gracefully close all connections and write remaining information to the database.

4. Remove the existing container

Let’s remove the container:

docker rm rippledvalidator

5. Remove the existing docker image

If we would re-create our container, Docker would just reuse our old container image (containing rippled 0.81.0). We are going to remove our image, so Docker will download the newest version from the Docker Hub:

docker rmi xrptipbot/rippledvalidator:latest

docker rm = remove container, docker rmi = remove image

6. Re-create the container. Docker will download the most recent image containing rippled

We will now combine the information from step 1 and step 2, and create a new container. We will mount the folder with our config, keys (and in case of the rippled-image: database) again. The command in my howto is:

docker run -dit \
    --name rippledvalidator \
    -p 51235:51235 \
    -v /My/Local/Disk/RippledKeystore/:/keystore/ \
    xrptipbot/rippledvalidator:latest

PLEASE NOTE! Replace /My/Local/Disk/RippledKeystore/ for the path step 1. showed. This is probably /keystore/. This line will then be:
-v /keystore/:/keystore/

You can update this command with your own ports and paths from step 1 and step 2. If you want to map multiple ports and/or multiple folders, just use the -p and/or -v arguments multiple times.

Now your new container is running, you can check the rippled-version with this command:

docker exec rippledvalidator /opt/ripple/bin/rippled server_info|grep version

Looks like (in the example above) we are now running 0.90.0 :)Looks like (in the example above) we are now running 0.90.0 :)

Github

If you cloned the docker-rippled-validator or the docker-rippled Github repository and you used the go/build and go/up commands these are your steps to update.

Use your terminal to go to the folder the repository is checked out, and fetch the most recent version:

git pull

Now take the container down using the script in the repository:

go/down

Since the go/build script removes the existing image, you can just build a new image; the newest rippled-version will automatically download for your new build:

go/build

Now launch your container based on the new image:

go/up

Now your new container is running, you can check the rippled-version with this command:

docker exec rippledvalidator /opt/ripple/bin/rippled server_info|grep version

Looks like (in the example above) we are now running 0.90.0 :)Looks like (in the example above) we are now running 0.90.0 :)


Did you like this post by Wietse Wind?

Send some love:

Wietse Wind

Wietse Wind

♥ Software, programming (nodejs, php, bash, ...), entrepreneurship, parrots and of course XRP (the XRPL) 🎉

Read More