Sections Prerequisites and Setup should be done only once per build host
Docker should be installed on build host following these instructions:
https://docs.docker.com/install/linux/docker-ce/centos/#set-up-the-repository
and
https://docs.docker.com/install/linux/docker-ce/centos/#install-docker-ce-1
Docker Compose should be installed on build host following instructions:
Add your build user into docker group (required to manage docker):
usermod -aG docker <username>
and relogin
Start Docker daemon
systemctl enable docker
systemctl start docker
Port 80 on build host should be free (stop nginx/httpd or move to different port)
Clone build repo with submodules (rpmbuild-php-7.2 is just an example - it could be any build repo):
git clone --recursive https://github.com/aursu/rpmbuild-php-7.2.git
cd rpmbuild-php-7.2
Setup build environment:
2.1. Setup rpmbuild base images
docker-compose -f rpmbuild/docker-compose.yml pull
2.4. Run webrepo service and createrepo service (see https://github.com/aursu/docker-rpmbuild/blob/master/README for details)
[aursu@envy rpmbuild-php-7.2]$ docker-compose -f rpmbuild/docker-compose.yml up -d
[aursu@envy rpmbuild-php-7.2]$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
b7d45e6da842 rpmbuild:webrepo "/usr/sbin/httpd -DF…" About a minute ago Up About a minute 0.0.0.0:80->80/tcp rpmbuild_webrepo_1
cda096b8ca05 rpmbuild:createrepo "/bin/sh -c /usr/loc…" About a minute ago Up 42 seconds rpmbuild_centos7repo_1
90705414e549 rpmbuild:createrepo "/bin/sh -c /usr/loc…" About a minute ago Up 42 seconds rpmbuild_centos6repo_1
2.5. Wait about 1 minute before any other build operation
Build images
docker-compose build
Build packages
docker-compose up -d
command above will start all build serrvices in background. But it is possible to run any of them or run in foreground etc
Wait until command docker-compose ps returns all services in state 'Exit 0'
docker cp command from container webrepo from paths
/home/centos-6/rpmbuild/RPMS and /home/centos-7/rpmbuild/RPMSTo complete all build processes run commands:
docker-compose down
docker-compose -f rpmbuild/docker-compose.yml down
These commands will stop and remove all containers but not build images (see
docker images and docker rmi commands manuals)
Content type
Image
Digest
Size
173.7 MB
Last updated
over 6 years ago
docker pull aursu/php72build:7-build-rel