Skip to content

Commit

Permalink
Merge pull request #164 from chrisburr/image-base
Browse files Browse the repository at this point in the history
Use diracx/server-base:latest as a basis of the docker image
  • Loading branch information
chaen authored Oct 26, 2023
2 parents ba6966b + 2c78367 commit 9397de7
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 45 deletions.
37 changes: 3 additions & 34 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
#TODO: replace with micromamba
FROM registry.cern.ch/docker.io/mambaorg/micromamba
FROM ghcr.io/diracgrid/diracx/server-base:latest
ARG MAMBA_DOCKERFILE_ACTIVATE=1
EXPOSE 8000

# Create empty directory for the various volume to be mounted
Expand All @@ -14,35 +14,4 @@ WORKDIR /code

COPY --chown=$MAMBA_USER:$MAMBA_USER . /code/diracx

# openssh is needed for ssh-keygen when we generate signing key
RUN micromamba install --yes --file diracx/environment.yml --name=base git openssh && micromamba clean --all --yes

ARG MAMBA_DOCKERFILE_ACTIVATE=1

RUN pip install ./diracx git+https://github.com/DIRACGrid/DIRAC.git@integration
# Copying in ENTRYPOINT script
COPY --chown=$MAMBA_USER:$MAMBA_USER dockerEntrypoint.sh /
RUN chmod 755 /dockerEntrypoint.sh

# Copying the mamba specific entrypoint with lower ulimit
COPY --chown=$MAMBA_USER:$MAMBA_USER dockerMicroMambaEntrypoint.sh /
RUN chmod 755 /dockerMicroMambaEntrypoint.sh

# In many clusters the container is ran as a random uid for security reasons.
# If we mark the conda directory as group 0 and give it group write permissions
# then we're still able to manage the environment from inside the container.
USER 0
RUN chown -R $MAMBA_USER:0 /opt/conda && chmod -R g=u /opt/conda
USER $MAMBA_USER

ENTRYPOINT [ "/dockerEntrypoint.sh" ]




# activate mamba for run commands
# RUN pip install ./diracx

# CMD ["uvicorn", "--factory", "diracx.routers:create_app", "--host", "0.0.0.0", "--port", "8000"]

# "--reload-dir", "/opt/conda/lib/python3.11/site-packages/diracx", "--reload"
RUN pip install ./diracx git+https://github.com/DIRACGrid/DIRAC.git@integration
6 changes: 0 additions & 6 deletions dockerEntrypoint.sh

This file was deleted.

5 changes: 0 additions & 5 deletions dockerMicroMambaEntrypoint.sh

This file was deleted.

0 comments on commit 9397de7

Please sign in to comment.