First, you'll need to pick a base image. There are lots to choose from and what you choose will entirely depend on what this service is. NodeJS, python, php, java, etc, all have really solid base images that I would recommend working from. If none of those frameworks apply then you'll need to work from an OS base image like debian or alpine. I highly recommend debian:stable-slim if you go this route.
My recommendation is to then spin up a container of your base image and do the install of your service manually, taking careful notes of all your steps. If anything breaks, just blow it up and start again. Once you have all your steps you'll need to convert that list into a Dockerfile. Go step by step and learn how to do each thing from the docs. Then you can build the image from the Dockerfile and upload to docker hub or anywhere else.