-
Notifications
You must be signed in to change notification settings - Fork 0
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
Replace Docker-in-Docker setup with multi-stage build. #86
Merged
Merged
Changes from all commits
Commits
Show all changes
9 commits
Select commit
Hold shift + click to select a range
5f0cdf5
Replace Docker-in-Docker setup with multi-stage build.
plietar d9ec964
Clean up the build scripts.
plietar 6794894
Make chrome installation more reliable and hermetic.
plietar 0737d37
Use new API
plietar fe9ad99
CR
plietar 5b9c7bf
CR
plietar ab4e1a6
CR
plietar ebe0500
CR
plietar 42e40e1
CR
plietar File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,14 @@ | ||
steps: | ||
- label: ":construction_worker: Build shared build env image" | ||
command: scripts/make-shared-build-env.sh | ||
|
||
- wait | ||
|
||
- label: ":construction_worker: Build integration test image" | ||
command: scripts/make-integration-test-image.sh | ||
|
||
- label: ":shipit: Build and push main image" | ||
command: scripts/run-build.sh | ||
command: scripts/build-image.sh | ||
|
||
- wait | ||
|
||
- label: ":mag: Run integration tests" | ||
command: scripts/run-integration-tests.sh | ||
|
||
- label: ":shipit: Build minimal test image" | ||
command: dev/run-build-minimal.sh | ||
command: dev/build-minimal-image.sh |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,19 +1,19 @@ | ||
#!/usr/bin/env bash | ||
set -ex | ||
|
||
org=vimc | ||
name=montagu-reverse-proxy-minimal | ||
HERE=$(dirname $0) | ||
. $HERE/../scripts/common | ||
|
||
# Deal with dependabot tags which look like | ||
# | ||
# dependabot/npm_and_yarn/app/lodash-4.17.19 | ||
# | ||
# But docker does not like | ||
MONTAGU_GIT_BRANCH=$(echo $MONTAGU_GIT_BRANCH | sed 's;/;-;g') | ||
MINIMAL_BRANCH_TAG=$ORG/montagu-reverse-proxy-minimal:$GIT_BRANCH | ||
MINIMAL_SHA_TAG=$ORG/montagu-reverse-proxy-minimal:$GIT_SHA | ||
|
||
commit_tag=$org/$name:$MONTAGU_GIT_ID | ||
branch_tag=$org/$name:$MONTAGU_GIT_BRANCH | ||
docker build \ | ||
-t $MINIMAL_BRANCH_TAG \ | ||
-t $MINIMAL_SHA_TAG \ | ||
-f dev/minimal.dockerfile \ | ||
. | ||
|
||
docker build -t $commit_tag -t $branch_tag . | ||
docker push $commit_tag | ||
docker push $branch_tag | ||
if [[ "$BUILDKITE" = "true" ]]; then | ||
docker push $MINIMAL_SHA_TAG | ||
docker push $MINIMAL_BRANCH_TAG | ||
fi |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
FROM node:16-buster | ||
|
||
WORKDIR /workspace | ||
COPY . /workspace | ||
|
||
RUN npm install | ||
RUN npm run test | ||
|
||
FROM nginx:stable | ||
|
||
COPY nginx.conf /etc/nginx/nginx.conf | ||
COPY dev/nginx.minimal.conf /etc/nginx/conf.d/montagu.conf | ||
COPY index.html /usr/share/nginx/html/index.html | ||
COPY 404.html /usr/share/nginx/html/404.html | ||
COPY resources /usr/share/nginx/html/resources | ||
|
||
# Copy third party javascript from npm modules | ||
ENV THIRDPARTY_JS_PATH /usr/share/nginx/html/resources/js/third_party/ | ||
COPY --from=0 /workspace/node_modules/pako/dist/pako.min.js $THIRDPARTY_JS_PATH | ||
COPY --from=0 /workspace/node_modules/vue/dist/vue.min.js $THIRDPARTY_JS_PATH | ||
COPY --from=0 /workspace/node_modules/jwt-decode/build/jwt-decode.min.js $THIRDPARTY_JS_PATH | ||
COPY --from=0 /workspace/node_modules/jquery/dist/jquery.min.js $THIRDPARTY_JS_PATH | ||
|
||
# Copy third party css from npm modules | ||
COPY --from=0 /workspace/node_modules/bootstrap/dist/css/bootstrap.min.css /usr/share/nginx/html/resources/css/third_party/ | ||
COPY --from=0 /workspace/node_modules/bootstrap/dist/css/bootstrap.min.css.map /usr/share/nginx/html/resources/css/third_party/ | ||
|
||
RUN rm /etc/nginx/conf.d/default.conf | ||
|
||
CMD exec nginx -g "daemon off;" |
This file was deleted.
Oops, something went wrong.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -7,7 +7,7 @@ x-logging: &log-journald | |
|
||
services: | ||
api: | ||
image: ${ORG}/montagu-api:master | ||
image: ${ORG}/montagu-api:abf39a2 | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. This is currently pointed at vimc/montagu-api#479, I'll update once that PR is merged. |
||
ports: | ||
- "8080:8080" | ||
networks: | ||
|
@@ -69,4 +69,4 @@ volumes: | |
static_volume: | ||
token_key_volume: | ||
networks: | ||
proxy: | ||
proxy: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,55 +1,38 @@ | ||
ARG MONTAGU_GIT_ID="UNKNOWN" | ||
FROM vimc/montagu-reverse-proxy-shared-build-env:$MONTAGU_GIT_ID | ||
FROM node:16-buster | ||
|
||
RUN apt-get update && apt-get install -yq \ | ||
default-jre \ | ||
gconf-service \ | ||
fonts-liberation \ | ||
libasound2 \ | ||
libatk1.0-0 \ | ||
libatk-bridge2.0-0 \ | ||
libc6 \ | ||
libcairo2 \ | ||
libatk1.0-0 \ | ||
libatspi2.0-0 \ | ||
libcups2 \ | ||
libdbus-1-3 \ | ||
libdrm2 \ | ||
libexpat1 \ | ||
libfontconfig1 \ | ||
libgcc1 \ | ||
libgconf-2-4 \ | ||
libgdk-pixbuf2.0-0 \ | ||
libglib2.0-0 \ | ||
libgtk-3-0 \ | ||
libgbm1 \ | ||
libgtk-3-0 \ | ||
libnspr4 \ | ||
libpango-1.0-0 \ | ||
libpangocairo-1.0-0 \ | ||
libstdc++6 \ | ||
libx11-6 \ | ||
libx11-xcb1 \ | ||
libxcb1 \ | ||
libnss3 \ | ||
libvulkan1 \ | ||
libxcomposite1 \ | ||
libxcursor1 \ | ||
libxdamage1 \ | ||
libxext6 \ | ||
libxfixes3 \ | ||
libxi6 \ | ||
libxkbcommon0 \ | ||
libxrandr2 \ | ||
libxrender1 \ | ||
libxss1 \ | ||
libxtst6 \ | ||
libu2f-udev \ | ||
libvulkan1 \ | ||
ca-certificates \ | ||
fonts-liberation \ | ||
libappindicator1 \ | ||
libnss3 \ | ||
lsb-release \ | ||
xdg-utils \ | ||
wget | ||
xdg-utils | ||
|
||
# Pick the version from https://googlechromelabs.github.io/chrome-for-testing/ | ||
ARG CHROME_VERSION="131.0.6778.85" | ||
|
||
RUN wget https://storage.googleapis.com/chrome-for-testing-public/$CHROME_VERSION/linux64/chrome-linux64.zip | ||
RUN wget https://storage.googleapis.com/chrome-for-testing-public/$CHROME_VERSION/linux64/chromedriver-linux64.zip | ||
|
||
RUN unzip -d /opt chrome-linux64.zip | ||
RUN unzip -d /opt chromedriver-linux64.zip | ||
|
||
RUN wget https://dl.google.com/linux/direct/google-chrome-stable_current_amd64.deb | ||
RUN dpkg -i google-chrome-stable_current_amd64.deb; apt-get -fy install | ||
ENV PATH="/opt/chrome-linux64:/opt/chromedriver-linux64:$PATH" | ||
|
||
RUN ./scripts/install-chromedriver.sh | ||
WORKDIR /workspace | ||
COPY . /workspace | ||
|
||
RUN npm install | ||
CMD npm run integration-test |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will it?
build-minimal-image.sh
references the.
Dockerfile, which is provided in thedev
folder along with the script, but if you're running that from the project root folder, won't it use the Dockerfile at the root? Might be better to give the dev (minimal) dockerfile a more explicit name likebuildMinimal.dockerfile
like it used to have.There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Seems like I just naively copy pasted this. Renamed to
dev/minimal.dockerfile
, and added the appropriate-f
flag.