02. [BackEnd] WSL2 + Go + VSCode + Docker + Make + Sqlc
WSL 설치
관리자모드로 powershell 실행
wsl 설치
wsl --install
microsoft store에서
windows terminal
설치reboot
유저 이름과 비밀번호 생성
make 설치
- apt 업데이트
sudo apt update
- make 설치
sudo apt install make
- 버전 확인
make -version
- 실행방법
시작에서 ubuntu
검색해서 실행하면 된다.
Golang 설치
but ! linux에서도 golang 설치해야 한다.
- golang 설치
sudo snap install go --classic
- golang 버전 확인
go version
Sqlc 설치
쿼리문을 Golang CRUD code로 작성해준다.
- Sqlc 설치
sudo snap install sqlc
VS Code 설치
VS Code 설치
Extension 설치하기
Extensions에서 wsl
,go
검색하고 설치
- settings.json에 한 줄 추가
"terminal.integrated.defaultProfile.windows": "Ubuntu (WSL)"
Docker 설치
- Docker 다운로드
이곳에서 다운로드
다운로드 파일 실행하지 말고 powershell 관리자 모드로 실행
다운로드 폴더로 이동
cd C:\Users\유저\Downloads
- 명령어로 설치
Start-Process "Docker Desktop Installer.exe" -Verb RunAs -Wait -ArgumentList "install --installation-dir=C:\Docker\"
설치 후 reboot
Docker app 실행
설정에서
Use the WSL 2 based engine
켜져있는지 확인Add the *.docker.internal names to the host's etc/hosts file (Requires password) 체크하기
우분투 터미널 켜서 확인하기
docker ps
go version