forked from eoftedal/containerify
-
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.
Push to insecure registries (eoftedal#40)
* fix(test): Make Node trust self-signed certificate for test * feat: Allow pushing without a token for registries that allow it * chore: adding Vegard S. Hagen as contributor
- Loading branch information
Showing
9 changed files
with
89 additions
and
13 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
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,6 +1,6 @@ | ||
{ | ||
"name": "containerify", | ||
"version": "3.0.1", | ||
"version": "3.1.0", | ||
"description": "Build node.js docker images without docker", | ||
"main": "./lib/cli.js", | ||
"scripts": { | ||
|
@@ -19,6 +19,9 @@ | |
"containerify": "./lib/cli.js" | ||
}, | ||
"author": "Erlend Oftedal <[email protected]>", | ||
"contributors": [ | ||
"Vegard S. Hagen <[email protected]>" | ||
], | ||
"license": "Apache-2.0", | ||
"repository": { | ||
"type": "git", | ||
|
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 +1 @@ | ||
export const VERSION = "3.0.1"; | ||
export const VERSION = "3.1.0"; |
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,56 @@ | ||
#!/bin/bash | ||
|
||
set -e | ||
|
||
export DOCKER_CONFIG=tmp | ||
LOCAL_REGISTRY=127.0.0.1 | ||
|
||
rm -rf tmp | ||
mkdir tmp | ||
|
||
printf "* Stopping any running local containerify test registry...\n" | ||
docker stop registry-containerify-insecure-test >/dev/null 2>&1 || echo "No running container registry, so nothing to stop" | ||
|
||
printf "* Starting local containerify test registry on port 5443...\n" | ||
docker run -d \ | ||
--rm \ | ||
--name registry-containerify-insecure-test \ | ||
-e REGISTRY_HTTP_ADDR=0.0.0.0:5443 \ | ||
-p 5443:5443 \ | ||
registry:2 > /dev/null | ||
|
||
printf "* Pulling node:alpine as base image...\n" | ||
docker pull node:alpine &> /dev/null | ||
|
||
printf "* Pushing base image to local containerify test registry...\n" | ||
docker tag node:alpine ${LOCAL_REGISTRY}:5443/node > /dev/null | ||
docker push ${LOCAL_REGISTRY}:5443/node > /dev/null | ||
|
||
printf "* Running containerify to pull from and push result to the local containerify test registry...\n" | ||
cd ../integration/app | ||
npm ci | ||
cd ../../localtest | ||
../../lib/cli.js \ | ||
--fromRegistry http://${LOCAL_REGISTRY}:5443/v2/ \ | ||
--fromImage node \ | ||
--toRegistry http://${LOCAL_REGISTRY}:5443/v2/ \ | ||
--toImage containerify-integration-test:localtest \ | ||
--doCrossMount \ | ||
--allowInsecureRegistries \ | ||
--allowNoPushAuth \ | ||
--folder ../integration/app --setTimeStamp "2024-01-18T13:33:33.337Z" \ | ||
|
||
printf "\n* Pulling image from registry to local docker daemon...\n" | ||
docker pull ${LOCAL_REGISTRY}:5443/containerify-integration-test:localtest &> /dev/null | ||
|
||
printf "* Running image on local docker daemon...\n" | ||
docker run --rm -it ${LOCAL_REGISTRY}:5443/containerify-integration-test:localtest | ||
|
||
printf "\n* Deleting image from registry to local docker daemon...\n" | ||
docker rmi ${LOCAL_REGISTRY}:5443/containerify-integration-test:localtest > /dev/null | ||
|
||
printf "* Stopping local containerify test registry...\n" | ||
docker stop registry-containerify-insecure-test > /dev/null | ||
rm -rf tmp | ||
|
||
printf "\nSUCCESS!\n" |
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