forked from dependabot/dependabot-core
-
Notifications
You must be signed in to change notification settings - Fork 1
/
Dockerfile.development
60 lines (52 loc) · 3.48 KB
/
Dockerfile.development
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
FROM dependabot/dependabot-core
# Temporarily switch to root user in order to install packages
USER root
RUN apt-get update \
&& apt-get install -y vim strace ltrace gdb shellcheck \
&& rm -rf /var/lib/apt/lists/*
USER dependabot
RUN git config --global user.name dependabot-ci \
&& git config --global user.email no-reply@github.com
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
ARG CODE_DIR=${HOME}/dependabot-core
COPY --chown=dependabot:dependabot common/Gemfile common/dependabot-common.gemspec ${CODE_DIR}/common/
COPY --chown=dependabot:dependabot common/lib/dependabot/version.rb ${CODE_DIR}/common/lib/dependabot/
WORKDIR ${CODE_DIR}
RUN cd common \
&& bundle install
COPY --chown=dependabot:dependabot bundler/Gemfile bundler/dependabot-bundler.gemspec ${CODE_DIR}/bundler/
COPY --chown=dependabot:dependabot cargo/Gemfile cargo/dependabot-cargo.gemspec ${CODE_DIR}/cargo/
COPY --chown=dependabot:dependabot composer/Gemfile composer/dependabot-composer.gemspec ${CODE_DIR}/composer/
COPY --chown=dependabot:dependabot docker/Gemfile docker/dependabot-docker.gemspec ${CODE_DIR}/docker/
COPY --chown=dependabot:dependabot elm/Gemfile elm/dependabot-elm.gemspec ${CODE_DIR}/elm/
COPY --chown=dependabot:dependabot git_submodules/Gemfile git_submodules/dependabot-git_submodules.gemspec ${CODE_DIR}/git_submodules/
COPY --chown=dependabot:dependabot github_actions/Gemfile github_actions/dependabot-github_actions.gemspec ${CODE_DIR}/github_actions/
COPY --chown=dependabot:dependabot go_modules/Gemfile go_modules/dependabot-go_modules.gemspec ${CODE_DIR}/go_modules/
COPY --chown=dependabot:dependabot gradle/Gemfile gradle/dependabot-gradle.gemspec ${CODE_DIR}/gradle/
COPY --chown=dependabot:dependabot hex/Gemfile hex/dependabot-hex.gemspec ${CODE_DIR}/hex/
COPY --chown=dependabot:dependabot maven/Gemfile maven/dependabot-maven.gemspec ${CODE_DIR}/maven/
COPY --chown=dependabot:dependabot npm_and_yarn/Gemfile npm_and_yarn/dependabot-npm_and_yarn.gemspec ${CODE_DIR}/npm_and_yarn/
COPY --chown=dependabot:dependabot nuget/Gemfile nuget/dependabot-nuget.gemspec ${CODE_DIR}/nuget/
COPY --chown=dependabot:dependabot python/Gemfile python/dependabot-python.gemspec ${CODE_DIR}/python/
COPY --chown=dependabot:dependabot terraform/Gemfile terraform/dependabot-terraform.gemspec ${CODE_DIR}/terraform/
RUN GREEN='\033[0;32m'; NC='\033[0m'; \
for d in `find ${CODE_DIR} -type f -mindepth 2 -maxdepth 2 \
-not -path "${CODE_DIR}/common/Gemfile" \
-name 'Gemfile' | xargs dirname`; do \
echo && \
echo "---------------------------------------------------------------------------" && \
echo "Installing gems for ${GREEN}$(realpath --relative-to=${CODE_DIR} $d)${NC}..." && \
echo "---------------------------------------------------------------------------" && \
cd $d && bundle install; \
done
COPY --chown=dependabot:dependabot omnibus/Gemfile omnibus/dependabot-omnibus.gemspec ${CODE_DIR}/omnibus/
RUN cd omnibus \
&& bundle install
# Make omnibus gems available to bundler in root directory
RUN echo 'eval_gemfile File.join(File.dirname(__FILE__), "omnibus/Gemfile")' > Gemfile
# Create directory for volume containing VS Code extensions, to avoid reinstalling on image rebuilds
RUN mkdir -p ~/.vscode-server ~/.vscode-server-insiders
# Declare pass-thru environment variables used for debugging
ENV LOCAL_GITHUB_ACCESS_TOKEN="" \
LOCAL_CONFIG_VARIABLES=""