docker
General info
docker
is a client which, among other things, allows for the pushing/pulling of container images to/from a registry.
Media type: application/vnd.docker.container.image.v1+json
Client homepage: https://www.docker.com/
Usage
Authentication
First, set the BB_USER
environment variable to your Bundle Bar username:
BB_USER="<insert_username_here>"
Next, create a token in the Bundle Bar UI and copy it into your clipboard. Set it in the BB_TOKEN
environment variable using one of the following commands:
BB_TOKEN="<insert_token_here>" # manual copy-paste
BB_TOKEN="$(pbpaste)" # with pbpaste
BB_TOKEN="$(xclip -o)" # with xclip
Note: the previous commands are intentionally prefixed with a space to prevent them from appearing in your history. This can be enabled in your shell with export HISTCONTROL=ignoreboth
.
Finally, run the following command to log in to Bundle Bar using docker
:
echo "$BB_TOKEN" | docker login bundle.bar -u $BB_USER --password-stdin
Pushing
# 1. Create a README.md to include in a Dockerfile
echo "Welcome to Bundle Bar" > README.md
# 2. Create a Dockerfile to build an image from
cat > Dockerfile <<EOF
FROM scratch
ADD README.md /README.md
EOF
# 3. Build the docker image
docker build -t bundle.bar/u/$BB_USER/docker/welcome:v1 .
# 4. Push the artifact
docker push bundle.bar/u/$BB_USER/docker/welcome:v1
Pulling
# 1. Pull the artifact
docker pull bundle.bar/u/$BB_USER/docker/welcome:v1
# 2. Check it out
docker inspect bundle.bar/u/$BB_USER/docker/welcome:v1
Installation
Official docs
Please see https://docs.docker.com/get-docker/.
Bundle Bar CDN
Since docker is widely available, we do not host it on our CDN.