-
Notifications
You must be signed in to change notification settings - Fork 839
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
[INFRA] Build and use optimized Docker image in Buildkite jobs #7372
Closed
Closed
Changes from all commits
Commits
Show all changes
23 commits
Select commit
Hold shift + click to select a range
ec3f64d
Splitting Dockerfile to use cached layer.
1Copenut 22104b3
Adding Docker build and push script for CI.
1Copenut ab49dd8
Refactor pipeline to cache container then run tests.
1Copenut c10bf65
Simplified shell test commands with yarn deps cached.
1Copenut 2ef2e90
Commented out a11y check. Refactored Docker login routine.
1Copenut 7d4c322
Main merge.
1Copenut 39f604b
Restructured env variables and shell script paths.
1Copenut 9884041
Changing the test image name to be more clear about its purpose.
1Copenut 0962caf
Refactored registry into secrets, removed a few hardcoded strings.
1Copenut bcd1521
Fixed an incorrect yarn command on a11y test invocation.
1Copenut d1449b3
Updating local Docker tests.
1Copenut eec4dd4
Forgot to update Docker image path in test config.
1Copenut cb30066
Typo in YML file.
1Copenut 0c9234b
Updated script path typos.
1Copenut 7ba378a
Adding Git and SSH deps to slim Docker image.
1Copenut 94fb7bf
Adding non-root user ID.
1Copenut e528d79
Simplifying yarn invocations in Docker image.
1Copenut 2e06a0b
Typo in the push location.
1Copenut 72b3392
Modifying script to change to app/ directory first to match Docker co…
1Copenut be96f3c
Adding back GCP to have access to docker CLI commands.
1Copenut 24582f8
Reverted one too many file paths.
1Copenut 83ac87b
Reverting to simpler GCP agent with optimized image.
1Copenut 67acc0e
Last Docker image path update. Fingers crossed.
1Copenut 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 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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
#!/bin/bash | ||
|
||
set -euo pipefail | ||
set +x | ||
|
||
echo "[DOCKER]: Get registry credentials & login" | ||
if [[ -z "${DOCKER_STAGING_USERNAME}" ]] || [[ -z "${DOCKER_STAGING_PASSWORD}" ]] || [[ -z "${DOCKER_STAGING_REGISTRY}" ]]; then | ||
echo ":fire: Docker credentials not set." 1>&2 | ||
exit 1 | ||
fi | ||
echo "${DOCKER_STAGING_PASSWORD}" | docker login -u "${DOCKER_STAGING_USERNAME}" --password-stdin "${DOCKER_STAGING_REGISTRY}" | ||
|
||
echo "[DOCKER]: Build and push container to registry" | ||
docker-compose -f ./scripts/docker-ci/docker-compose.yml build app | ||
docker push "${DOCKER_STAGING_REGISTRY}"/eui/ci:latest | ||
|
||
echo "[DOCKER]: Log out of registry" | ||
docker logout |
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 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,16 @@ | ||
FROM node:18.18.2-alpine as base | ||
|
||
WORKDIR /app | ||
|
||
COPY package.json /app/ | ||
COPY yarn.lock /app/ | ||
|
||
RUN apk --no-cache add yarn && yarn | ||
|
||
FROM node:18.18.2-alpine as dependencies | ||
|
||
WORKDIR /app | ||
|
||
COPY --from=base app/package.json /app/ | ||
COPY --from=base app/yarn.lock /app/ | ||
COPY --from=base app/node_modules /app/node_modules/ |
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,17 @@ | ||
services: | ||
dependencies: | ||
build: | ||
dockerfile: ./Dockerfile.deps | ||
volumes: | ||
- '.:/app' | ||
- '/app/node_modules' | ||
|
||
app: | ||
image: container-registry-test.elastic.co/eui/ci | ||
build: | ||
dockerfile: ./Dockerfile.app | ||
working_dir: /app | ||
volumes_from: | ||
- "dependencies" | ||
depends_on: | ||
- "dependencies" |
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
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.
It doesn't hurt to have this file, but FYI you shouldn't need it either... The process should exit right after this, so all of the env vars will be gone anyway