forked from dependabot/dependabot-core
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Dockerfile.development
72 lines (60 loc) · 3.56 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
61
62
63
64
65
66
67
68
69
70
71
72
ARG FROM_IMAGE=dependabot/dependabot-core
FROM $FROM_IMAGE
# Temporarily switch to root user in order to install packages
USER root
RUN apt-get update \
&& apt-get install -y --no-install-recommends \
vim \
strace \
ltrace \
gdb \
shellcheck \
# Required for updater/ development
libgit2-dev \
cmake \
pkg-config \
&& 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 HOME=/home/dependabot
ARG CODE_DIR=${HOME}/dependabot-core
# Prepare the common & omnibus gems
COPY --chown=dependabot:dependabot common/Gemfile common/dependabot-common.gemspec ${CODE_DIR}/common/
COPY --chown=dependabot:dependabot common/lib/dependabot.rb ${CODE_DIR}/common/lib/
COPY --chown=dependabot:dependabot omnibus/Gemfile omnibus/dependabot-omnibus.gemspec ${CODE_DIR}/omnibus/
# Prepare the ecosystem gems
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 pub/Gemfile pub/dependabot-pub.gemspec ${CODE_DIR}/pub/
COPY --chown=dependabot:dependabot terraform/Gemfile terraform/dependabot-terraform.gemspec ${CODE_DIR}/terraform/
# Prepare the updater project
COPY --chown=dependabot:dependabot updater/Gemfile updater/Gemfile.lock ${CODE_DIR}/updater/
WORKDIR ${CODE_DIR}
RUN for d in `find ${CODE_DIR} -type f -mindepth 2 -maxdepth 2 -name 'Gemfile' | xargs dirname`; do \
cd $d && bundle config path ${CODE_DIR}/omnibus/.bundle; \
done
RUN cd omnibus \
&& bundle install \
&& BUNDLE_BIN=.bundle/bin bundle binstubs --all \
&& rm .bundle/bin/bundle # let RubyGems manage Bundler
ENV PATH="${CODE_DIR}/omnibus/.bundle/bin:$PATH"
# 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=""