2021-04-12 23:28:06 +09:00
|
|
|
## CentOS RPM package building environment by Teddysun
|
|
|
|
|
|
|
|
This docker image can be used to build RPM packages.
|
|
|
|
|
|
|
|
For more information on docker and containerization technologies, refer to [official document][1].
|
|
|
|
|
|
|
|
## Supported tags and respective `Dockerfile` links
|
|
|
|
|
|
|
|
- `latest`, `8` [*(Dockerfile)*][2]
|
2021-11-20 21:24:04 +09:00
|
|
|
- `rockylinux`[*(Dockerfile)*][7]
|
2021-04-12 23:28:06 +09:00
|
|
|
- `7` [*(Dockerfile)*][3]
|
|
|
|
|
|
|
|
### Reference
|
|
|
|
|
2021-11-20 21:24:04 +09:00
|
|
|
- Supported architectures ([*more info*][4]): `amd64`
|
2021-04-12 23:28:06 +09:00
|
|
|
|
|
|
|
## Integration
|
|
|
|
|
|
|
|
RPMs will be built in `/home/builder/rpmbuild` folder, which should contain source archives, patches and built RPM/SRPM files.
|
|
|
|
|
|
|
|
## Prepare the host
|
|
|
|
|
|
|
|
If you need to install docker by yourself, follow the [official installation guide][5].
|
|
|
|
|
|
|
|
## User Account and Root Access
|
|
|
|
|
|
|
|
The `builder` user (UID 1000) is a member of users and wheel, and has password-less sudo as any user, any group.
|
|
|
|
|
|
|
|
## Pull the image
|
|
|
|
|
2021-04-17 23:55:10 +09:00
|
|
|
For CentOS 6
|
|
|
|
|
|
|
|
```bash
|
|
|
|
$ docker pull teddysun/rpmbuild:6
|
|
|
|
```
|
|
|
|
|
2021-04-12 23:28:06 +09:00
|
|
|
For CentOS 7
|
|
|
|
|
|
|
|
```bash
|
|
|
|
$ docker pull teddysun/rpmbuild:7
|
|
|
|
```
|
|
|
|
|
|
|
|
For CentOS 8
|
|
|
|
|
|
|
|
```bash
|
|
|
|
$ docker pull teddysun/rpmbuild:8
|
|
|
|
```
|
|
|
|
|
2021-11-20 21:24:04 +09:00
|
|
|
For Rockylinux 8
|
2021-04-17 23:55:10 +09:00
|
|
|
|
|
|
|
```bash
|
2021-11-20 21:24:04 +09:00
|
|
|
$ docker pull teddysun/rpmbuild:rockylinux
|
2021-04-17 23:55:10 +09:00
|
|
|
```
|
|
|
|
|
2021-11-20 21:24:04 +09:00
|
|
|
It can be found at [Docker Hub][6].
|
|
|
|
|
|
|
|
## Start a container
|
|
|
|
|
2021-04-12 23:28:06 +09:00
|
|
|
There is an example to start a container for CentOS 7 like below:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
$ mkdir -m 777 -p /opt/builder7
|
2021-04-12 23:54:16 +09:00
|
|
|
$ docker run -it --rm -h buildbot --name rpmbuild7 -v /opt/builder7:/home/builder/rpmbuild teddysun/rpmbuild:7
|
2021-04-12 23:28:06 +09:00
|
|
|
```
|
|
|
|
|
|
|
|
There is an example to start a container for CentOS 8 like below:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
$ mkdir -m 777 -p /opt/builder8
|
2021-04-12 23:54:16 +09:00
|
|
|
$ docker run -it --rm -h buildbot --name rpmbuild8 -v /opt/builder8:/home/builder/rpmbuild teddysun/rpmbuild:8
|
2021-04-12 23:28:06 +09:00
|
|
|
```
|
|
|
|
|
2021-11-20 21:24:04 +09:00
|
|
|
There is an example to start a container for Rockylinux 8 like below:
|
|
|
|
|
|
|
|
```bash
|
|
|
|
mkdir -m 777 -p /opt/rockylinux
|
|
|
|
docker run -it --rm -h buildbot --name rockylinux8 -v /opt/rockylinux:/home/builder/rpmbuild teddysun/rpmbuild:rockylinux
|
|
|
|
```
|
|
|
|
|
2021-04-12 23:28:06 +09:00
|
|
|
[1]: https://docs.docker.com/
|
|
|
|
[2]: https://github.com/teddysun/across/blob/master/docker/rpmbuild/Dockerfile.centos8
|
|
|
|
[3]: https://github.com/teddysun/across/blob/master/docker/rpmbuild/Dockerfile.centos7
|
|
|
|
[4]: https://github.com/docker-library/official-images#architectures-other-than-amd64
|
|
|
|
[5]: https://docs.docker.com/install/
|
2021-04-17 23:55:10 +09:00
|
|
|
[6]: https://hub.docker.com/r/teddysun/rpmbuild/
|
2021-11-20 21:24:04 +09:00
|
|
|
[7]: https://github.com/teddysun/across/blob/master/docker/rpmbuild/Dockerfile.rockylinux
|