일 | 월 | 화 | 수 | 목 | 금 | 토 |
---|---|---|---|---|---|---|
1 | 2 | 3 | ||||
4 | 5 | 6 | 7 | 8 | 9 | 10 |
11 | 12 | 13 | 14 | 15 | 16 | 17 |
18 | 19 | 20 | 21 | 22 | 23 | 24 |
25 | 26 | 27 | 28 | 29 | 30 | 31 |
Tags
- 카카오api
- 유니티에서 안드로이드 플러그인 사용하기
- Logitech 무선 키보드 먹통
- picpick
- 자동 스크롤 캡쳐
- local module
- C# Chromium
- PickPic
- 태그
- CefSharp
- create-react-app
- Go local module
- go
- 실업급여 동영상
- 로지텍 무선 키보드 먹통
- Microsoft Edge 실업급여 동영상 흰 화면
- Go lang 로컬 모듈 불러오기
- 로컬 모듈
- 키보드 먹통
- file://
- TouchEn nxKey 키보드 먹통
- create-react-app 빌드된 소스코드를 파일로 실행하기
- 픽픽
- 크롬 스크롤 캡쳐
- 보안프로그램 키보드 먹통
- go language
Archives
- Today
- Total
블로그
[Bash Shell Script] docker 설치 스크립트 본문
※ Windows 11 Home 환경에서 실행하였습니다.
※ WSL2 Ubuntu 24.04 환경에서 실행하였습니다.
공식 문서의 설치 방법 중 Install using the apt repository 과정을 스크립트 하나로 만들었습니다.
1. vim 또는 vi로 파일 생성
vim docker.install
2. 스크립트 코드 작성
#!/bin/bash
# @(#)docker.install
# Add Docker's official GPG key:
sudo apt-get update
sudo apt-get install ca-certificates curl
sudo install -m 0755 -d /etc/apt/keyrings
sudo curl -fsSL https://download.docker.com/linux/ubuntu/gpg -o /etc/apt/keyrings/docker.asc
sudo chmod a+r /etc/apt/keyrings/docker.asc
# Add the repository to Apt sources:
echo \
"deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.asc] https://download.docker.com/linux/ubuntu \
$(. /etc/os-release && echo "$VERSION_CODENAME") stable" | \
sudo tee /etc/apt/sources.list.d/docker.list > /dev/null
sudo apt-get update -y && \
sudo apt-get install -y docker-ce docker-ce-cli containerd.io docker-buildx-plugin docker-compose-plugin && \
sudo docker run hello-world
3. 스크립트 저장.
:wq
4. 스크립트 실행 권한 설정
sudo chmod +x docker.install
5. 스크립트 실행
./docker.install
6. 결과 확인
Hello from Docker!
This message shows that your installation appears to be working correctly.
To generate this message, Docker took the following steps:
1. The Docker client contacted the Docker daemon.
2. The Docker daemon pulled the "hello-world" image from the Docker Hub.
(amd64)
3. The Docker daemon created a new container from that image which runs the
executable that produces the output you are currently reading.
4. The Docker daemon streamed that output to the Docker client, which sent it
to your terminal.
To try something more ambitious, you can run an Ubuntu container with:
$ docker run -it ubuntu bash
Share images, automate workflows, and more with a free Docker ID:
https://hub.docker.com/
For more examples and ideas, visit:
https://docs.docker.com/get-started/
'프로그래밍 > Bash Shell Script' 카테고리의 다른 글
[Bash Shell Script] docker 제거 스크립트 (5) | 2024.11.14 |
---|