diff --git a/Dockerfile b/Dockerfile index 62e6829..f830042 100644 --- a/Dockerfile +++ b/Dockerfile @@ -3,23 +3,18 @@ FROM python:3.7-slim-buster COPY entrypoint /entrypoint RUN useradd -u 54000 radio && \ - apt update && \ - apt install -y git && \ - cd /usr/src/ && \ - git clone https://github.com/hacknix/dmr_utils && \ - cd /usr/src/dmr_utils && \ - ./install.sh && \ - rm -rf /var/lib/apt/lists/* && \ - cd /opt && \ - rm -rf /usr/src/dmr_utils && \ - git clone https://github.com/hacknix/freedmr && \ - cd /opt/freedmr/ && \ - sed -i s/.*python.*//g requirements.txt && \ - pip install --no-cache-dir -r requirements.txt && \ - chown radio /opt/freedmr - -USER radio + apt update && \ + apt install -y git gcc && \ + cd /opt && \ + git clone https://github.com/hacknix/freedmr && \ + cd freedmr && \ + pip install --no-cache-dir -r requirements.txt && \ + apt autoremove -y git gcc && \ + rm -rf /var/lib/apt/lists/* && \ + chown -R radio: /opt/freedmr EXPOSE 54000 +USER radio + ENTRYPOINT [ "/entrypoint" ] diff --git a/README.md b/README.md index e9f74f6..4bdb96c 100755 --- a/README.md +++ b/README.md @@ -39,17 +39,23 @@ This document assumes the reader is familiar with Linux/UNIX, the Python program **Using the docker version** -Build the docker image +Build the docker image. ```bash docker build --tag freedmr . ``` -Start your container +Start your container, passing your configuration file. ```bash cfg_file="/absolute/path/to/cfg/file" -run -v $cfg_file:/opt/freedmr/hblink.cfg -p 54000:54000 freedmr +docker run -v $cfg_file:/opt/freedmr/hblink.cfg -p 54000:54000 freedmr +``` + +Note that `$cfg_file` is used by the container's 'radio' user internally, so you may need to modify file permissions. + +```bash +chmod 666 $cfg_file ``` **MORE DOCUMENTATION TO COME**