Skip to content

Commit

Permalink
ubuntu as docker base w non-root user
Browse files Browse the repository at this point in the history
  • Loading branch information
d-callan committed Jan 6, 2025
1 parent 276be4b commit f0d0334
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 5 deletions.
18 changes: 15 additions & 3 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,13 +1,25 @@
FROM alpine:3.21.0
FROM ubuntu:24.04

# Install build dependencies
RUN apk add --no-cache build-base cmake
RUN apt-get update && \
apt-get install -y build-essential cmake

# Add a non-root user
RUN groupadd -r hyphyuser && useradd -r -g hyphyuser hyphyuser

# Create a directory for the project
WORKDIR /hyphy

# Copy project files
COPY . /hyphy
COPY ./cmake /hyphy/cmake
COPY ./src /hyphy/src
COPY ./contrib /hyphy/contrib
COPY ./res /hyphy/res
COPY CMakeLists.txt /hyphy

RUN chown -R hyphyuser:hyphyuser .

# Install project
RUN cmake . && make install

USER hyphyuser
6 changes: 4 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,13 +10,15 @@ HyPhy is an open-source software package for the analysis of genetic sequences u
`conda install -c bioconda hyphy`

#### Running with Docker
You can also run HyPhy without having to install it on your system using the provided Dockerfile. Following the below instructions starts an interactive Docker container where HyPhy is already available.
You can also run HyPhy without having to install it on your system using the provided Dockerfile. Following the below instructions starts an interactive Docker container where HyPhy is already available.

**Please note you must change this code snippet to point to the appropriate location for your input data. This will be made available inside the container at `/hyphy/data`.**

```
git clone https://github.com/veg/hyphy.git
cd hyphy
docker build -t hyphy:latest .
docker run --rm -it hyphy:latest
docker run --rm -v [path-to-your-input-data]:/hyphy/data -it hyphy:latest
```

#### Run with Command Line Arguments
Expand Down

0 comments on commit f0d0334

Please sign in to comment.