- postgresql-14 관련 rpm파일 다운로드 받기

postgresql14-libs-14.1-1PGDG.rhel8.x86_64.rpm
postgresql14-14.1-1PGDG.rhel8.x86_64.rpm
postgresql14-server-14.1-1PGDG.rhel8.x86_64.rpm
postgresql14-contrib-14.1-1PGDG.rhel8.x86_64.rpm

 

- 설치 

cd /usr/local/src/postgresql_rpms
dnf install -y postgresql14-libs-14.1-1PGDG.rhel8.x86_64.rpm
dnf install -y postgresql14-14.1-1PGDG.rhel8.x86_64.rpm
dnf install -y postgresql14-server-14.1-1PGDG.rhel8.x86_64.rpm
dnf install -y postgresql14-contrib-14.1-1PGDG.rhel8.x86_64.rpm

 

- DB초기화

su - postgres -c "/usr/pgsql-14/bin/initdb -D /usr/local/src/pgsql/14/data"

- SVN설치

dnf install -y subversion

 

- docker-compose 다운받기(OS에 맞는 버전 다운로드)

https://github.com/docker/compose/releases

 

Releases · docker/compose

Define and run multi-container applications with Docker - docker/compose

github.com

- 실행 파일로 만들기

cp ./docker-compose-linux-x86_64 /usr/local/bin/docker-compose
ln -s /usr/local/bin/docker-compose /usr/bin/docker-compose
chmod -x /usr/bin/docker-compose

 

- 버전 확인

docker-compose -v

- 구분(awk)

ls -altr | awk '{print $6}'

 

- 숫자만 출력(sed)

echo ls -altr | awk '{print $6} | sed 's/[^0-9]//g'

 

 

- docker download

http://hub.docker.com/

 

Docker Hub Container Image Library | App Containerization

Increase your reach and adoption on Docker Hub With a Docker Verified Publisher subscription, you'll increase trust, boost discoverability, get exclusive data insights, and much more.

hub.docker.com

docker search rocky
docker pull rockylinux/rockylinux:8

 

- image 목록

docker image ls

 

- container 생성

docker create -ti --name test_rocky rockylinux/rockylinux:8

 

- container 실행 및 진입

docker start test_rocky
docker container ps
docker attach test_rocky

- Disk 상태 확인

lsblk
fdisk -l

 

- Disk 생성

[test@localhost ~]# fdisk /dev/sdb1
Welcome to fdisk (util-linux 2.23.2).

Changes will remain in memory only, until you decide to write them.
Be careful before using the write command.

Device does not contain a recognized partition table
Building a new DOS disklabel with disk identifier 0xa536c7c6.

Command (m for help): n
Partition type:
   p   primary (0 primary, 0 extended, 4 free)
   e   extended
Select (default p): p
Partition number (1-4, default 1): 1
First sector (2048-209713151, default 2048):
Using default value 2048
Last sector, +sectors or +size{K,M,G} (2048-209713151, default 209713151):
Using default value 209713151
Partition 1 of type Linux and of size 100 GiB is set
w

[test@localhost ~]# fdisk -l

 

- mount 

[test@localhost ~]mkfs.xfs /dev/sdb1
[test@localhost ~]mkdir /test
[test@localhost ~]mount /dev/sdb1 /test

 

- 부팅 후에도 자동 mount

[test@localhost ~]vi /etc/fstab
/dev/sdb1 /test xfs defaults 0 0

- docker 설치를 위한 디렉토리를 생성 및 이동한다.

mkdir /usr/local/src/docker-installer
cd /usr/local/src/docker-installer

 

- 아래의 목록을 다운로드 한다.(http://mirror.kakao.com/centos/7.9.2009/extras/x86_64/Packages/)

wget http://mirror.kakao.com/centos/7.9.2009/extras/x86_64/Packages/container-selinux-2.119.2-1.911c772.el7_8.noarch.rpm
wget http://mirror.kakao.com/centos/7.9.2009/extras/x86_64/Packages/fuse3-libs-3.6.1-4.el7.x86_64.rpm
wget http://mirror.kakao.com/centos/7.9.2009/extras/x86_64/Packages/fuse-overlayfs-0.7.2-6.el7_8.x86_64.rpm
wget http://mirror.kakao.com/centos/7.9.2009/extras/x86_64/Packages/slirp4netns-0.4.3-4.el7_8.x86_64.rpm

- 아래의 목록을 다운로드 한다.(https://download.docker.com/linux/centos/7/x86_64/stable/Packages/)

wget https://download.docker.com/linux/centos/7/x86_64/stable/Packages/containerd.io-1.6.21-3.1.el7.x86_64.rpm
wget https://download.docker.com/linux/centos/7/x86_64/stable/Packages/docker-compose-plugin-2.18.1-1.el7.x86_64.rpm
wget https://download.docker.com/linux/centos/7/x86_64/stable/Packages/docker-buildx-plugin-0.10.5-1.el7.x86_64.rpm
wget https://download.docker.com/linux/centos/7/x86_64/stable/Packages/docker-ce-cli-24.0.1-1.el7.x86_64.rpm
wget https://download.docker.com/linux/centos/7/x86_64/stable/Packages/docker-ce-rootless-extras-24.0.2-1.el7.x86_64.rpm
wget https://download.docker.com/linux/centos/7/x86_64/stable/Packages/docker-ce-24.0.1-1.el7.x86_64.rpm

 

- yum local repository 설정

https://powergi.tistory.com/entry/yum-local-repository-%EB%A7%8C%EB%93%A4%EA%B8%B0

 

yum local repository 만들기

- OS설치 CD나 USB로 특정 디렉토리에 마운트 하기#> mount /dev/sr0 /media#> cd /media/Packages #> mkdir /usr/local/src/Packages#> cp -rf /media/Packages/* /usr/local/src/Packages/

powergi.tistory.com

 

- 위에서 다운받은 패키지를 설치한다.

yum install -y container-selinux-2.119.2-1.911c772.el7_8.noarch.rpm
yum install -y containerd.io-1.6.21-3.1.el7.x86_64.rpm
yum install -y docker-compose-plugin-2.18.1-1.el7.x86_64.rpm
yum install -y docker-buildx-plugin-0.10.5-1.el7.x86_64.rpm
yum install -y docker-ce-cli-24.0.1-1.el7.x86_64.rpm
yum install -y fuse3-libs-3.6.1-4.el7.x86_64.rpm
yum install -y fuse-overlayfs-0.7.2-6.el7_8.x86_64.rpm
yum install -y slirp4netns-0.4.3-4.el7_8.x86_64.rpm
yum install -y docker-ce-rootless-extras-24.0.2-1.el7.x86_64.rpm docker-ce-24.0.1-1.el7.x86_64.rpm

 

- docker 실행 

systemctl enable docker
systemctl start docker

 

- docker 권한 설정

chmod 666 /var/run/docker.sock
usermod -aG docker ${USER}

 

- docker 저장 위치 변경

mkdir -p /test/docker/docker-root
vi /etc/docker/daemon.json
systemctl start docker
# daemon.json
{
	"data-root": "/test/docker/docker-root"
}

- OS설치 CD나 USB로 특정 디렉토리에 마운트 하기

mount /dev/sr0 /media
cd /media/Packages 
mkdir /usr/local/src/centos7/Packages
cp -rf /media/Packages/* /usr/local/src/centos7/Packages/

 

- createrepo 설치

cd /usr/local/src/centos7/Packages/
yum localinstall -y createrepo-0.9.9-28.el7.noarch

 

- Repository 위치 지정

# CentOS 7
createrepo /usr/local/src/centos7
# Rocky Linux 8.1
createrepo /usr/local/src/centos7

- Repository 설정

# CentOS 7
cd /etc/yum.repo.d
rm -rf CentOS*
vi local-CentOS7.repo
#CentOS 7
[Centos7-local-repo]
name=CentOS7 Local Repository
baseurl=file:///usr/local/src/centos7
gpgcheck=0
enabled=1
# Rocky Linux 8.1
# local-Rocky-BaseOS.repo
[Rocky8-local-baseos]
name=Rocky8 Local Repository - BaseOS
baseurl=file:///usr/local/src/rocky8/BaseOS
gpgcheck=0
enabled=1


# local-Rocky-AppStream.repo
[Rocky8-local-appstream]
name=Rocky8 Local Repository - AppStream
baseurl=file:///usr/local/src/rocky8/AppStream
gpgcheck=0
enabled=1

- yum 동작 확인

# CentOS 7 - yum
yum clean all
yum repolist
# Rocky Linux 8.1 - dnf
dnf clean all
dnf repo list
dnf makecache

+ Recent posts