Skip to content

Commit

Permalink
feat: try this one again
Browse files Browse the repository at this point in the history
  • Loading branch information
beckermr committed Oct 2, 2024
1 parent dfdb350 commit 3d5c8f5
Show file tree
Hide file tree
Showing 2 changed files with 21 additions and 16 deletions.
35 changes: 20 additions & 15 deletions Dockerfile_wda
Original file line number Diff line number Diff line change
@@ -1,13 +1,6 @@
FROM --platform=linux/amd64 mambaorg/micromamba:1.5.10-noble
LABEL maintainer="conda-forge <[email protected]>"

ENV LANG=en_US.UTF-8 \
LANGUAGE=en_US.UTF-8 \
TMPDIR=/tmp \
CF_FEEDSTOCK_OPS_DIR=/opt/cf-feedstock-ops \
CF_FEEDSTOCK_OPS_ENV=cf-feedstock-ops \
PYTHONDONTWRITEBYTECODE=1
FROM mambaorg/micromamba:1.5.10-noble AS build-env

ENV PYTHONDONTWRITEBYTECODE=1
USER root

# make sure the install below is not cached by docker
Expand All @@ -24,11 +17,25 @@ RUN echo "**** install base env ****" && \
mkdir -p "${MAMBA_ROOT_PREFIX}/locks" && \
chmod 777 "${MAMBA_ROOT_PREFIX}/locks"

FROM frolvlad/alpine-glibc:alpine-3.16_glibc-2.34
LABEL maintainer="conda-forge <[email protected]>"

ENV LANG=en_US.UTF-8 \
LANGUAGE=en_US.UTF-8 \
TMPDIR=/tmp \
CF_FEEDSTOCK_OPS_DIR=/opt/cf-feedstock-ops \
CF_FEEDSTOCK_OPS_ENV=cf-feedstock-ops

RUN apk add --no-cache bash

COPY --from=build-env /opt/conda /opt/conda
COPY --from=build-env /usr/bin/micromamba /usr/bin/micromamba

# use bash for a while to make conda manipulations easier
SHELL ["/bin/bash", "-l", "-c"]

# Lucky group gets permission to write in the conda dir
RUN groupadd -g 32766 lucky && \
RUN addgroup -g 32766 lucky && \
chown -R root /opt/conda && \
chgrp -R lucky /opt/conda && chmod -R g=u /opt/conda

Expand All @@ -45,7 +52,7 @@ RUN chmod +x /opt/docker/bin/entrypoint
# cd -

# now make the conda user for running tasks and set the user
RUN useradd --shell /bin/bash -c "" -m conda
RUN adduser --disabled-password --shell /bin/bash conda
ENV HOME=/home/conda \
USER=conda \
LOGNAME=conda \
Expand All @@ -60,11 +67,9 @@ RUN chown conda:conda $HOME && \
USER conda

# deal with git config for user and mounted directory
RUN micromamba shell init -s bash
RUN eval "$(micromamba shell hook --shell bash)" && \
RUN micromamba shell init -s bash && \
source $HOME/.bashrc && \
micromamba activate $CF_FEEDSTOCK_OPS_ENV && \
echo $PATH && \
ls -lah /opt/conda/envs/cf-feedstock-ops && \
git config --global --add safe.directory /cf_feedstock_ops_dir && \
git config --global init.defaultBranch main && \
git config --global user.email "[email protected]" && \
Expand Down
2 changes: 1 addition & 1 deletion entrypoint_wda
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
#!/bin/bash

# source profile scripts for conda
source ~/.bash_profile
source ~/.bashrc

# activate env
micromamba activate $CF_FEEDSTOCK_OPS_ENV
Expand Down

0 comments on commit 3d5c8f5

Please sign in to comment.