forked from GoogleContainerTools/kaniko
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Change integration tests to use docker hub instead of GCR due to bug in library that requires authentication with gcr.io even for public images. See GoogleContainerTools#966 for bug tracking this. - Make uploading to GCS bucket configurable through a flag --uploadToGCS - Utilize a locally deployed docker registry in travis CI to remove dependency of needing to authenticate with GCP. This requires host networking such that we can access the registry on localhost:5000 - Use the commit that's being tested for `TestGitBuildcontext` - Remove duplicate GitBuildContext case that's now covered by default in travis CI.
- Loading branch information
Showing
23 changed files
with
109 additions
and
91 deletions.
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
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,10 +1,21 @@ | ||
language: go | ||
os: linux | ||
|
||
dist: bionic | ||
env: | ||
- IMAGE_REPO=localhost:5000 | ||
go: | ||
- "1.13.3" | ||
go_import_path: github.com/GoogleContainerTools/kaniko | ||
before_install: | ||
- curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo apt-key add - | ||
- sudo add-apt-repository "deb [arch=amd64] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | ||
- sudo apt-get update | ||
- sudo apt-get -y -o Dpkg::Options::="--force-confnew" install docker-ce | ||
- curl -LO https://storage.googleapis.com/container-diff/latest/container-diff-linux-amd64 && chmod +x container-diff-linux-amd64 && sudo mv container-diff-linux-amd64 /usr/local/bin/container-diff | ||
- docker run -d -p 5000:5000 --restart always --name registry registry:2 | ||
- ./integration/replace-gcr-with-local-registry.sh integration/dockerfiles | ||
|
||
script: | ||
- make test | ||
- ./integration-test.sh --uploadToGCS=false | ||
- make images |
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
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,5 +1,4 @@ | ||
FROM gcr.io/distroless/base@sha256:628939ac8bf3f49571d05c6c76b8688cb4a851af6c7088e599388259875bde20 AS first | ||
FROM debian:10.2 AS first | ||
CMD ["mycmd"] | ||
|
||
FROM first | ||
ENTRYPOINT ["myentrypoint"] # This should clear out CMD in the config metadata |
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
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
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
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
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,29 @@ | ||
#!/bin/bash | ||
|
||
# This script is needed due to the following bug: | ||
# https://github.com/GoogleContainerTools/kaniko/issues/966 | ||
|
||
|
||
if [ "$#" -ne 1 ]; then | ||
echo "Please specify path to dockerfiles as first argument." | ||
echo "Usage: `basename $0` integration/dockerfiles" | ||
exit 2 | ||
fi | ||
|
||
dir_with_docker_files=$1 | ||
|
||
for dockerfile in $dir_with_docker_files/*; do | ||
cat $dockerfile | grep '^FROM' | grep "gcr" | while read -r line; do | ||
gcr_repo=$(echo "$line" | awk '{ print $2 }') | ||
local_repo=$(echo "$gcr_repo" | sed -e "s/^.*gcr.io\(\/.*\)$/localhost:5000\1/") | ||
remove_digest=$(echo "$local_repo" | cut -f1 -d"@") | ||
echo "Running docker pull $gcr_repo" | ||
docker pull "$gcr_repo" | ||
echo "Running docker tag $gcr_repo $remove_digest" | ||
docker tag "$gcr_repo" "$remove_digest" | ||
echo "Running docker push $remove_digest" | ||
docker push "$remove_digest" | ||
echo "Updating dockerfile $dockerfile to use local repo $local_repo" | ||
sed -i -e "s/^\(FROM \).*gcr.io\(.*\)$/\1localhost:5000\2/" $dockerfile | ||
done | ||
done |