-
Notifications
You must be signed in to change notification settings - Fork 69
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
ubuntu as docker base w non-root user
- Loading branch information
Showing
2 changed files
with
19 additions
and
5 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters