Skip to content

Commit

Permalink
Switch to salesforce/cli based
Browse files Browse the repository at this point in the history
  • Loading branch information
jlantz authored May 2, 2024
1 parent bec0b66 commit d438e4c
Showing 1 changed file with 13 additions and 24 deletions.
37 changes: 13 additions & 24 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,31 +1,20 @@
FROM python:3.11-slim-bookworm
FROM salesforce/cli:latest-full

LABEL org.opencontainers.image.source = "https://github.com/muselab-d2x/d2x"

# Install sfdx
RUN apt-get update
RUN apt-get upgrade -y
RUN apt-get install -y gnupg wget curl git gcc libc-dev

RUN \
echo "deb https://deb.nodesource.com/node_20.x bullseye main" > /etc/apt/sources.list.d/nodesource.list && \
wget -qO- https://deb.nodesource.com/gpgkey/nodesource.gpg.key | apt-key add - && \
apt-get update
RUN apt-get install -y nodejs
RUN npm install --global npm jq commander
RUN npm install --global sfdx-cli --ignore-scripts

# Install Salesforce CLI plugins:
RUN sfdx plugins:install @salesforce/sfdx-scanner
# Install Python
RUN apt-get update; \
apt-get upgrade -y; \
apt-get install -y python3-pip

# Install GitHub CLI
RUN curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | gpg --dearmor -o /usr/share/keyrings/githubcli-archive-keyring.gpg;
RUN echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null;
RUN apt-get install -y gh
RUN curl -fsSL https://cli.github.com/packages/githubcli-archive-keyring.gpg | gpg --dearmor -o /usr/share/keyrings/githubcli-archive-keyring.gpg; \
echo "deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/githubcli-archive-keyring.gpg] https://cli.github.com/packages stable main" | tee /etc/apt/sources.list.d/github-cli.list > /dev/null; \
apt-get install -y gh

# Install CumulusCI
RUN pip install --no-cache-dir --upgrade pip pip-tools \
pip --no-cache-dir install cookiecutter git+https://github.com/muselab-d2x/d2x-cli.git@main
pip --no-cache-dir install git+https://github.com/muselab-d2x/d2x-cli@main cookiecutter

# Copy devhub auth script and make it executable
COPY devhub.sh /usr/local/bin/devhub.sh
Expand All @@ -35,10 +24,10 @@ RUN chmod +x /usr/local/bin/devhub.sh
RUN useradd -r -m -s /bin/bash -c "D2X User" d2x

# Setup PATH
RUN echo 'export PATH=~/.local/bin:$PATH' >> /root/.bashrc
RUN echo 'export PATH=~/.local/bin:$PATH' >> /home/d2x/.bashrc
RUN echo '/usr/local/bin/devhub.sh' >> /root/.bashrc
RUN echo '/usr/local/bin/devhub.sh' >> /home/d2x/.bashrc
RUN echo 'export PATH=~/.local/bin:$PATH' >> /root/.bashrc;\
echo 'export PATH=~/.local/bin:$PATH' >> /home/d2x/.bashrc;\
echo '/usr/local/bin/devhub.sh' >> /root/.bashrc;\
echo '/usr/local/bin/devhub.sh' >> /home/d2x/.bashrc

USER d2x
CMD ["bash"]

0 comments on commit d438e4c

Please sign in to comment.