2016-10-29

Docker Registry



Docker Registry


Overview of Docker Hub
https://docs.docker.com/docker-hub/


Docker Hub is a cloud-based registry service which allows you to link to code repositories, build your images and test them, stores manually pushed images, and links to Docker Cloud so you can deploy images to your hosts. It provides a centralized resource for container image discovery, distribution and change management, user and team collaboration, and workflow automation throughout the development pipeline.


1.
tux@slitaz:~$ docker pull slitaz/slitaz-base
Using default tag: latest
latest: Pulling from slitaz/slitaz-base
757636f5b664: Pull complete
Digest: sha256:39b71bbc4cd7f031c865b79dcf6f92bef97cf399e9fce70404437b0b742730dc
Status: Downloaded newer image for slitaz/slitaz-base:latest

tux@slitaz:~$ docker images
REPOSITORY           TAG                 IMAGE ID            CREATED             SIZE
slitaz/slitaz-base   latest              2cc6e5f30b3a        13 days ago         12.82 MB


2.
tux@slitaz:~$ docker run -it slitaz/slitaz-base
root@28fabc3863a6:/# tazpkg recharge



3.
root@28fabc3863a6:/# tazpkg -gi slitaz-toolchain

Connecting to slitaz64.96.lt (31.220.16.60:80)
slitaz-toolchain-5.0 100% |*******************************| 4708 0:00:00 ETA

Tracking dependencies for: slitaz-toolchain
================================================================================
Missing: binutils
Missing: linux-api-headers
Missing: glibc-dev
Missing: gcc
Missing: make
Missing: elfkickers
================================================================================
6 missing packages to install.

Connecting to slitaz64.96.lt (31.220.16.60:80)
binutils-2.25-x86_64 100% |*******************************| 1184k 0:00:00 ETA

Tracking dependencies for: binutils
[..]

Installation of: slitaz-toolchain
================================================================================
Copying slitaz-toolchain...[ Done ]
Extracting slitaz-toolchain...[ Done ]
Installing slitaz-toolchain...[ Done ]
Removing all tmp files...[ Done ]
================================================================================
slitaz-toolchain (5.0) is installed.


4.
root@28fabc3863a6:/# gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-slitaz-linux/4.9.2/lto-wrapper
Target: x86_64-slitaz-linux
Configured with: /home/slitaz/wok/gcc/source/gcc-4.9.2/configure --libexecdir=/usr/lib --enable-nls --enable-languages=c,c++ --enable-shared --with-system-zlib --enable-clocale=gnu --enable-__cxa_atexit --enable-lto --enable-threads=posix --disable-bootstrap --disable-multilib --libdir=/usr/libgcc --with-tune=generic --with-pkgversion=SliTaz --build=x86_64-slitaz-linux --host=x86_64-slitaz-linux
Thread model: posix
gcc version 4.9.2 (SliTaz)
root@28fabc3863a6:/#


5.
root@28fabc3863a6:/# tazpkg -cc

Path: /var/cache/tazpkg
================================================================================
Cleaning cache directory...[ Done ]
================================================================================
14 files removed from cache.

root@28fabc3863a6:/# du -sh /
169.0M /

root@28fabc3863a6:/# cat /var/lib/tazpkg/installed.md5 | wc -l
38


6.
root@28fabc3863a6:/# exit
tux@slitaz:~$ docker ps -a

CONTAINER ID        IMAGE                COMMAND             CREATED             STATUS                      PORTS               NAMES
28fabc3863a6        slitaz/slitaz-base   "/bin/sh"           15 minutes ago      Exited (0) 14 seconds ago                       modest_lamport


7.
tux@slitaz:~$ docker commit 28fabc slitaz/slitaz-gcc
sha256:0c8d8c5581ecca210d50b121cc35e5d8481d669a96b0ff3806bd7a4cd5b0e303


tux@slitaz:~$ docker images
REPOSITORY           TAG                 IMAGE ID            CREATED             SIZE
slitaz/slitaz-gcc    latest              0c8d8c5581ec        15 seconds ago      170.1 MB
slitaz/slitaz-base   latest              2cc6e5f30b3a        13 days ago         12.82 MB
tux@slitaz:~$


8.
tux@slitaz:~$ docker run -it slitaz/slitaz-gcc
root@afa3ef941987:/# gcc -v
Using built-in specs.
COLLECT_GCC=gcc
COLLECT_LTO_WRAPPER=/usr/lib/gcc/x86_64-slitaz-linux/4.9.2/lto-wrapper
Target: x86_64-slitaz-linux
Configured with: /home/slitaz/wok/gcc/source/gcc-4.9.2/configure --libexecdir=/usr/lib --enable-nls --enable-languages=c,c++ --enable-shared --with-system-zlib

 --enable-clocale=gnu --enable-__cxa_atexit --enable-lto --enable-threads=posix --disable-bootstrap --disable-multilib --libdir=/usr/libgcc --with-tune=generic --with-pkgversion=SliTaz --build=x86_64-slitaz-linux --host=x86_64-slitaz-linux
Thread model: posix
gcc version 4.9.2 (SliTaz)


9.
root@afa3ef941987:/# exit
tux@slitaz:~$ docker search slitaz-gcc
NAME DESCRIPTION STARS OFFICIAL AUTOMATED


10.
tux@slitaz:~$ docker login -u slitaz -p xxxxxx
Login Succeeded

tux@slitaz:~$ docker push slitaz/slitaz-gcc
The push refers to a repository [docker.io/slitaz/slitaz-gcc]
e37d60de3ae8: Pushed
b2cd1ae2e434: Mounted from slitaz/slitaz-base
latest: digest: sha256:27800b007f60fb3267658b48f749560e0335b29a1bc01e94b270dda294f4ecb0 size: 740


tux@slitaz:~$ docker search slitaz-gcc
NAME                DESCRIPTION        STARS     OFFICIAL   AUTOMATED
slitaz/slitaz-gcc