728x90
0. pemkey 읽기 권한 주기
chmod 400 *.pem
1. docker 설치
sudo apt-get update
sudo apt-get install apt-transport-https ca-certificates curl software-properties-common
curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /usr/share/keyrings/docker-archive-keyring.gpg
echo "deb [arch=amd64 signed-by=/usr/share/keyrings/docker-archive-keyring.gpg] https://download.docker.com/linux/ubuntu $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update
sudo apt-get install docker-ce docker-ce-cli containerd.io
sudo systemctl start docker
sudo systemctl enable docker
// 권한
sudo usermod -aG docker ubuntu
sudo chown ubuntu:docker /var/run/docker.sock
sudo chmod 660 /var/run/docker.sock
1-1 docker compose 설치
sudo apt update
sudo apt install curl unzip
sudo curl -L "https://github.com/docker/compose/releases/latest/download/docker-compose-$(uname -s)-$(uname -m)" -o /usr/local/bin/docker-compose
sudo chmod +x /usr/local/bin/docker-compose
2. java 17 openjdk
sudo apt update
sudo apt install openjdk-17-jdk
3. ssh 키 발급
ssh-keygen -t rsa
# 공개키
cat /home/ubuntu/.ssh/id_rsa.pub
# 비밀키
cat /home/ubuntu/.ssh/id_rsa
# ed25519
ssh-keygen -t ed25519
4. mysql 설치
sudo apt update
sudo apt install mysql-server
5. mysql 계정 생성 및 권한
mysql -u root -p
// 내부
CREATE USER '계정아이디'@'localhost' IDENTIFIED BY '비밀번호';
// 외부
CREATE USER '계정아이디'@'%' IDENTIFIED BY '비밀번호';
// 권한 부여
GRANT ALL PRIVILEGES ON *.* TO '계정아이디'@'호스트';
// 적용
flush privileges;
// 디렉토리 권한
sudo chmod -R 777 /var/lib/mysql
6. mysql 바인딩 설정
vi /etc/mysql/mysql.conf.d/mysqld.cnf
// 재시작
sudo service mysql restart
7. mysql 데이터베이스 생성
CREATE DATABASE name CHARACTER SET utf8 COLLATE utf8_bin;
8. nginx 설치
sudo apt update
sudo apt install nginx
sudo useradd -s /bin/false nginx
Nginx 시작: sudo systemctl start nginx
Nginx 중지: sudo systemctl stop nginx
Nginx 재시작: sudo systemctl restart nginx
Nginx 상태 확인: sudo systemctl status nginx
부팅 시 Nginx 시작 활성화: sudo systemctl enable nginx
9. gitlab Runner 설치
sudo curl -L --output /usr/local/bin/gitlab-runner https://gitlab-runner-downloads.s3.amazonaws.com/latest/binaries/gitlab-runner-linux-amd64
sudo chmod +x /usr/local/bin/gitlab-runner
sudo useradd --comment 'GitLab Runner' --create-home gitlab-runner --shell /bin/bash
sudo gitlab-runner install --user=gitlab-runner --working-directory=/home/gitlab-runner
sudo gitlab-runner start
# dind로 설치
sudo gitlab-runner register -n \
--url YOUR_URL \
--registration-token YOUR_REGISTRATION_TOKEN \
--executor docker \
--description "My Docker Runner" \
--docker-image "docker:stable" \
--docker-privileged
# docker도 깔아줘야함!
최종 Runner 상태
sudo vi /etc/gitlab-runner/config.toml
[[runners]]
name = "My Docker Runner"
url = ""
id = 7
token = ""
token_obtained_at =
token_expires_at =
executor = "docker"
environment = ["DOCKER_DRIVER=overlay2", "DOCKER_TLS_CERTDIR="]
pre_build_script = "export DOCKER_HOST=tcp://docker:2375"
[runners.docker]
tls_verify = false
image = "docker:stable"
privileged = true
disable_entrypoint_overwrite = false
oom_kill_disable = false
disable_cache = false
volumes = ["/cache"]
shm_size = 0
10. nodejs 설치
curl -o- https://raw.githubusercontent.com/nvm-sh/nvm/v0.39.1/install.sh | bash
source ~/.bashrc
nvm install 18
728x90
'모아두고 나중에 쓰기' 카테고리의 다른 글
나만의 맥 초기 세팅 (0) | 2024.11.21 |
---|---|
[IntelliJ] 단축키 (MacOS) (0) | 2023.08.20 |