rport icon indicating copy to clipboard operation
rport copied to clipboard

Provide rport on Docker Hub

Open tdpsk opened this issue 4 years ago • 11 comments

Currently, we build RPort server as a docker image ourselves. However, an official rport Docker image on Docker Hub would be useful for staying up-to-date and might make installing easier for new users.

tdpsk avatar Oct 16 '21 17:10 tdpsk

Care to share your docker image?

cfredericksen avatar Oct 17 '21 03:10 cfredericksen

Right now it contains some specific data, I'll try and find a way to generalize and share it

tdpsk avatar Oct 18 '21 14:10 tdpsk

@tdpsk Maybe just post your Dockerfile here and I can finish it?

cfredericksen avatar Oct 21 '21 00:10 cfredericksen

any idea when this will be released?

ajagnanan avatar Nov 12 '21 20:11 ajagnanan

In case this helps anybody:

FROM alpine:3.15 as downloader

ARG rport_version=0.4.2
ARG frontend_build=0.4.1-build-731

RUN apk add unzip

WORKDIR /app/

RUN wget -q https://github.com/cloudradar-monitoring/rport/releases/download/${rport_version}/rport_${rport_version}_Linux_x86_64.tar.gz -O rportd.tar.gz
RUN wget -q https://downloads.rport.io/frontend/stable/rport-frontend-stable-${frontend_build}.zip -O frontend.zip

RUN tar xzf rportd.tar.gz rportd

RUN unzip frontend.zip -d ./frontend


FROM debian:11.1

COPY --from=downloader /app/rportd /usr/local/bin/rportd
COPY --from=downloader /app/frontend/ /var/www/html/

COPY ./start-rportd.sh /usr/local/bin/

RUN useradd -d /var/lib/rport -m -U -r -s /bin/false rport

USER rport

VOLUME [ "/var/lib/rport/" ]

EXPOSE 8080
EXPOSE 3000

ENTRYPOINT [ "/bin/bash", "/usr/local/bin/start-rportd.sh", "--data-dir", "/var/lib/rport" ]

Just keep in mind that you still have to add a config file (preferably as a mounted read-only volume pointing to your local file). My docker-compose.yml looks as follows:


  rportd:
    build: ./rportd
    restart: unless-stopped
    ports:
      - 3000:3000
      - 8081:8080
    command: -c /etc/rport/rportd.conf
    volumes:
      - ./dev/rportd/rportd.conf:/etc/rport/rportd.conf

If you are using client auth files, your start-rportd.sh file should look like this:

#!/bin/bash

# ensure we have at least an empty auth file
export AUTH_FILE=/var/lib/rport/client-auth.json
if [[ ! -e $AUTH_FILE ]]; then
    mkdir -p `dirname $AUTH_FILE`
    echo "{}" > $AUTH_FILE
    echo "Created empty $AUTH_FILE"
fi

/usr/local/bin/rportd $@

Also: you still have the same license requirements for the frontend, please honor them!

As a sidenote: I would have loved to use alpine as the base image for the "runner", but unfortunately rportd doesn't run on alpine (despite rport running perfectly).

UncleSamSwiss avatar Dec 12 '21 20:12 UncleSamSwiss

@UncleSamSwiss What happens on with rportd on alpine? IIRC golang doesn't rely on libc and statically links.

nwmcsween avatar Feb 25 '22 18:02 nwmcsween

@m-terel I looked at git blame and it looks like rport tried to use with CGO_ENABLED=0 and static linking, is there a reason this was disabled?

nwmcsween avatar Feb 26 '22 21:02 nwmcsween

I created a repo based on the input from @UncleSamSwiss with auto-builds (linux/amd64 & linux/arm64) here: https://github.com/yusufhm/rport-image

Also added the ability to generate the conf using environment variables.

yusufhm avatar Mar 21 '22 00:03 yusufhm

Hi all,

I also created an image of rport that contain guacd to use RDP via browser, fail2ban and iptables.

https://github.com/AC-WhiteGlint/rport-docker

@yusufhm I like you approach with the env directly into the docker-compose, however it would be great in that case to allow to modify all conf options of the rportd.conf file (I know there is a lot of entry to modify).

Regarding my build of rport you have to provide the rportd.conf file directly into the container (as well as the certificates)

IOTech17 avatar Mar 29 '22 08:03 IOTech17

Hey @AC-WhiteGlint, you can actually also provide the rportd.conf as well if you wanted as a volume (that's how I do it in Kubernetes actually, no env vars provided); if that's the case, the entrypoint script will not run and therefore ignore any environment variables, if set.

yusufhm avatar Mar 29 '22 10:03 yusufhm

Hi, i am new to Docker, i allready use dolibarr on a synology docker, can you assist a little on how i get rport running on my synology docker?

JRFPlows avatar Apr 28 '22 10:04 JRFPlows