Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Revert Update dev and ci Dockerfile to match updater #3279 #3320

Merged
merged 1 commit into from
Mar 23, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
65 changes: 23 additions & 42 deletions Dockerfile.ci
Original file line number Diff line number Diff line change
@@ -1,29 +1,12 @@
FROM dependabot/dependabot-core

USER root

ARG USERNAME=dependabot
ARG DEPENDABOT_HOME=/home/${USERNAME}
ARG CODE_DIR=${DEPENDABOT_HOME}/dependabot-core

# Install project dependencies as an unprivileged user
RUN useradd -m ${USERNAME} && mkdir ${CODE_DIR}
RUN chown -R ${USERNAME}:${USERNAME} \
${CODE_DIR} \
/usr/local/.pyenv \
/opt/go/gopath \
/opt/rust/ \
/opt/bundler/

ARG CODE_DIR=/home/dependabot/dependabot-core
WORKDIR ${CODE_DIR}

USER ${USERNAME}

ENV BUNDLE_PATH="${CODE_DIR}/.bundle" \
BUNDLE_BIN=".bundle/bin"
ENV PATH="$BUNDLE_BIN:$PATH:$BUNDLE_PATH/bin"
ENV BUNDLE_PATH="/home/dependabot/.bundle" \
BUNDLE_BIN=".bundle/binstubs" \
PATH=".bundle/binstubs:$PATH:/home/dependabot/.bundle/bin"

COPY .rubocop.yml ${CODE_DIR}/
COPY .rubocop.yml /home/dependabot/dependabot-core/

RUN mkdir -p \
${CODE_DIR}/bundler \
Expand Down Expand Up @@ -84,25 +67,23 @@ RUN cd python && bundle install
RUN cd terraform && bundle install
RUN cd omnibus && bundle install

# Set the owner to be dependabot instead of defaulting to `root` allowing test
# helpers to writing to the spec folder
COPY --chown=${USERNAME}:${USERNAME} common/ ${CODE_DIR}/common/
COPY --chown=${USERNAME}:${USERNAME} bundler/ ${CODE_DIR}/bundler/
COPY --chown=${USERNAME}:${USERNAME} cargo/ ${CODE_DIR}/cargo/
COPY --chown=${USERNAME}:${USERNAME} composer/ ${CODE_DIR}/composer/
COPY --chown=${USERNAME}:${USERNAME} dep/ ${CODE_DIR}/dep/
COPY --chown=${USERNAME}:${USERNAME} docker/ ${CODE_DIR}/docker/
COPY --chown=${USERNAME}:${USERNAME} elm/ ${CODE_DIR}/elm/
COPY --chown=${USERNAME}:${USERNAME} git_submodules/ ${CODE_DIR}/git_submodules/
COPY --chown=${USERNAME}:${USERNAME} github_actions/ ${CODE_DIR}/github_actions/
COPY --chown=${USERNAME}:${USERNAME} go_modules/ ${CODE_DIR}/go_modules/
COPY --chown=${USERNAME}:${USERNAME} gradle/ ${CODE_DIR}/gradle/
COPY --chown=${USERNAME}:${USERNAME} hex/ ${CODE_DIR}/hex/
COPY --chown=${USERNAME}:${USERNAME} maven/ ${CODE_DIR}/maven/
COPY --chown=${USERNAME}:${USERNAME} npm_and_yarn/ ${CODE_DIR}/npm_and_yarn/
COPY --chown=${USERNAME}:${USERNAME} nuget/ ${CODE_DIR}/nuget/
COPY --chown=${USERNAME}:${USERNAME} python/ ${CODE_DIR}/python/
COPY --chown=${USERNAME}:${USERNAME} terraform/ ${CODE_DIR}/terraform/
COPY --chown=${USERNAME}:${USERNAME} omnibus/ ${CODE_DIR}/omnibus/
COPY common/ ${CODE_DIR}/common/
COPY bundler/ ${CODE_DIR}/bundler/
COPY cargo/ ${CODE_DIR}/cargo/
COPY composer/ ${CODE_DIR}/composer/
COPY dep/ ${CODE_DIR}/dep/
COPY docker/ ${CODE_DIR}/docker/
COPY elm/ ${CODE_DIR}/elm/
COPY git_submodules/ ${CODE_DIR}/git_submodules/
COPY github_actions/ ${CODE_DIR}/github_actions/
COPY go_modules/ ${CODE_DIR}/go_modules/
COPY gradle/ ${CODE_DIR}/gradle/
COPY hex/ ${CODE_DIR}/hex/
COPY maven/ ${CODE_DIR}/maven/
COPY npm_and_yarn/ ${CODE_DIR}/npm_and_yarn/
COPY nuget/ ${CODE_DIR}/nuget/
COPY python/ ${CODE_DIR}/python/
COPY terraform/ ${CODE_DIR}/terraform/
COPY omnibus/ ${CODE_DIR}/omnibus/

RUN git config --global user.name dependabot-ci && git config --global user.email no-reply@github.com
10 changes: 4 additions & 6 deletions Dockerfile.development
Original file line number Diff line number Diff line change
Expand Up @@ -15,28 +15,26 @@ RUN apt-get update && apt-get install -y vim strace ltrace gdb
ARG USER_UID=1000
ARG USER_GID=$USER_UID
ARG USERNAME=dependabot
ARG DEPENDABOT_HOME=/home/${USERNAME}

RUN groupadd -o --gid "${USER_GID}" "${USERNAME}" && \
useradd --uid "${USER_UID}" --gid "${USER_GID}" -m "${USERNAME}"
RUN chown -R "${USERNAME}":"${USERNAME}" \
/usr/local/.pyenv \
/opt/go/gopath \
/opt/rust/ \
/opt/bundler/
/opt/rust/
USER $USERNAME
RUN git config --global user.name dependabot-ci && git config --global user.email no-reply@github.com

ARG CODE_DIR=${DEPENDABOT_HOME}/dependabot-core
ARG CODE_DIR=/home/$USERNAME/dependabot-core

RUN curl -L -o ~/.vimrc https://github.com/hmarr/dotfiles/raw/main/vimrc-vanilla.vim && \
echo 'export PS1="[dependabot-core-dev] \w \[$(tput setaf 4)\]$ \[$(tput sgr 0)\]"' >> ~/.bashrc

RUN mkdir -p ${CODE_DIR}/common/lib/dependabot
WORKDIR ${CODE_DIR}

ENV BUNDLE_PATH="${CODE_DIR}/.bundle" \
BUNDLE_BIN=".bundle/bin"
ENV BUNDLE_PATH="/home/$USERNAME/.bundle" \
BUNDLE_BIN=".bundle/binstubs"
ENV PATH="$BUNDLE_BIN:$PATH:$BUNDLE_PATH/bin"

COPY common/Gemfile common/dependabot-common.gemspec ${CODE_DIR}/common/
Expand Down