Under Docker ----- deepin mounting system registry docker

Environment Description

Forced a pit environment, we can not say pit force, and domestic demand thing.

root@node22:/registry# uname -a
Linux node22 4.4.15-deepin-aere #137 SMP Tue Dec 18 17:06:43 CST 2018 sw_64 GNU/Linux
root@node22:/registry# lsb_release -a
No LSB modules are available.
Distributor ID: deepin
Description:    deepin 15.2
Release:        15.2
Codename:       kui

I directly installed apt-get installed the docker services

According to the official installation of the base image depth provided a good basis for a mirror service.

This is the mirror base container https://docs.deepin.cn/d/fbcc4fb4b6/

The question is, registry can not find sw_64 container architecture in the official website.

Only a compilation yourself.

go deployment environment

# Apply mirrored boot container

docker run -it -d --name registry  -p 4000:5000  deepin 

# This time found a problem, can not be installed within the container package

# Switch at the source file otherwise there will be problems installation package

docker cp /etc/apt/sources.list registry:/etc/apt

# /Etc/apt/sources.list index synchronization source and /etc/apt/sources.list.d listed, so as to get the latest software packages.

apt-get update

# Installation environment go

apt-get install golang-go git make
mkdir -p $HOME/go/{bin,pkg,src}
# Set Environment Variables
export GOROOT=/usr/lib/go
export GOPATH=$HOME/go
export PATH=$PATH:$GOROOT/bin:$GOPATH/bin
source /etc/profile

Source compiler

Download Source #
cd $HOME/go/src
git clone https://github.com/docker/distribution.git
cd distribution
# Install dependencies
go get

# Configuration container image file
mkdir -p /etc/docker/registry/
cp cmd / registry / config-dev.yml /etc/docker/registry/config.yml
mkdir -p /var/lib/registry

# Compiler
make PREFIX=$HOME/go clean binaries

# This Docker Registry compiled, tested below

Start Detection service

# View version and run

cd bin
./registry -v
./registry serve /etc/docker/registry/config.yml 

Access to the local port 5000, see the returns "200 OK", it shows a success
in order to facilitate the start-up command into script

root@fb469b1c0702:~# more registry.sh
#!/bin/bash
../root/registry serve /etc/docker/registry/config.yml

# You can do this at the registry mirror commit

docker commit registry kolla/ubuntu-source-registry

 # Configure about the service starts with the container

root@node22:/ljy/now# more Dockerfile
# Build a registry for deepin sw_64
FROM kolla/ubuntu-source-registry
CMD ["sh", "-c", "sh  /root/registry.sh"]

docker build -t kolla/ubuntu-source-registry .

# Mirroring start container

docker run -it -d --name registry  -p 4000:5000 -v /registry:/var/lib/registry kolla/ubuntu-source-registry

 

Guess you like

Origin www.cnblogs.com/jinyuanliu/p/11032402.html