Docker Install

Ubuntu 22.04 Install ๊ธฐ์กด ํŒจํ‚ค์ง€๋กœ ์„ค์น˜ - ๋‚ฎ์€ ๋ฒ„์ „(1.5-2) $ sudo apt update $ sudo apt install docker docker-engine docker.io containerd runc ์ €์žฅ์†Œ๋กœ ์ตœ์‹  ๋ฒ„์ „ ์„ค์น˜ (20.10.21) - docker-ce๋งŒ ์„ค์น˜ํ•ด๋„ ๋œ๋‹ค. $ sudo apt update $ sudo apt install ca-certificates curl gnupg lsb-release -y $ sudo mkdir -p /etc/apt/keyrings $ curl -fsSL https://download.docker.com/linux/ubuntu/gpg | sudo gpg --dearmor -o /etc/apt/keyrings/docker.gpg $ echo \ "deb [arch=$(dpkg --print-architecture) signed-by=/etc/apt/keyrings/docker.gpg] https://download.docker.com/linux/ubuntu \ $(lsb_release -cs) stable" | sudo tee /etc/apt/sources.list.d/docker.list > /dev/null $ sudo apt update $ sudo apt-get install docker-ce docker-ce-cli containerd.io docker-compose-plugin -y Script Install $ curl -fsSL https://get.docker.com -o get-docker.sh $ DRY_RUN=1 sudo sh ./get-docker.sh Test $ sudo docker --version # ๋ฒ„์ „ ํ™•์ธ $ sudo systemctl status docker # ์„œ๋น„์Šค Active ํ™•์ธ $ sudo docker run hello-world # ํ…Œ์ŠคํŠธ $ sudo docker ps -a # ํ”„๋กœ์„ธ์Šค fhrm ghkrdls Uninstall $ sudo apt-get purge docker-ce docker-ce-cli containerd.io docker-compose-plugin -y Links https://docs.docker.com/engine/reference/builder https://linuxhint.com/install-docker-ubuntu-22-04 https://www.digitalocean.com/community/tutorials/how-to-install-and-use-docker-on-ubuntu-22-04

2022-11-09 ยท 150 words

Docker - ์†Œํ”„ํŠธ์›จ์–ด ๊ฐœ๋ฐœ ํ”Œ๋žซํผ

Intro docker๋Š” ์‘์šฉํ”„๋กœ๊ทธ๋žจ ๊ฐœ๋ฐœ์„ ์œ„ํ•œ ์†Œํ”„ํŠธ์›จ์–ด ํ”Œ๋žซํผ์ด๋‹ค. Linux ๊ธฐ๋ฐ˜์—์„œ ๋…๋ฆฝ๋œ ์ปจํ…Œ์ด๋„ˆ(ํ•˜๋‚˜์˜ ํ”„๋กœ์„ธ์Šค) ํ˜•ํƒœ๋กœ ๋™์ž‘ํ•œ๋‹ค. go ์–ธ์–ด๋กœ ๊ฐœ๋ฐœ๋˜์—ˆ๋‹ค. ๊ฐ€์ƒOS์™€๋Š” ๋‹ค๋ฅด๊ฒŒ ๊ฐ€๋ณ๊ณ  ๋น ๋ฅด๋‹ค. ๋นŒ๋“œ๋œ ์ด๋ฏธ์ง€๋ฅผ ์–ธ์ œ ์–ด๋””์—์„œ๋Š” docker๋ฅผ ํ†ตํ•ด ๋ฌธ์ œ ์—†์ด ์‹คํ–‰ํ•  ์ˆ˜ ์žˆ๋‹ค. ์ž์‹ ๋งŒ์˜ ๊ฐœ๋ฐœํ™˜๊ฒฝ์„ ์ด๋ฏธ์ง€๋กœ ๊ตฌ์ถ•ํ•ด ๋†“์œผ๋ฉด ๊ฐœ๋ฐœ ์ปดํ“จํ„ฐ๊ฐ€ ๋‹ฌ๋ผ์ ธ๋„ ๋™์ผํ•œ ํ™˜๊ฒฝ์—์„œ ๊ฐœ๋ฐœํ•  ์ˆ˜ ์žˆ๋‹ค. ์‹คํ–‰ํ™˜๊ฒฝ์„ ์ด๋ฏธ์ง€๋กœ ๋งŒ๋“ค์–ด ๋†“์œผ๋ฉด ์‚ฌ์šฉ์ž๊ฐ€ ๋™์ผํ•œ ํ™˜๊ฒฝ์—์„œ ๋ฌธ์ œ์—†์ด ์‹คํ–‰ํ•  ์ˆ˜ ์žˆ๋‹ค. Docker ์„ค์น˜ ๋ฐ ๊ธฐ๋ณธ ์‚ฌ์šฉ๋ฒ• docker install - Docker ์„ค์น˜ docker setup - Docker ์„ค์ • docker build - Dockerfile ์ž‘์„ฑ dockerhub - Docker Hub์™€ ํšŒ์› ๊ฐ€์ž… docker example - Docker Example: ์‚ฌ์šฉ๋ก€ Docker Tips docker run cmd entrypoint - Docker run, cmd, entrypoint ์ฐจ์ด docker images remove - Docker Image ์ œ๊ฑฐ Docker ์‘์šฉ docker busybox - ๋„์ปค busybox ํ™œ์šฉ docker windows - ์œˆ๋„์šฐ์ฆˆ์—์„œ ๋„์ปค ์„ค์น˜ ๋ฐ ์‚ฌ์šฉ Links https://hub.docker.com/ https://www.sobyte.net/post/2022-04/docker-copy/ https://docs.docker.com/engine/reference/builder/

2022-11-09 ยท (updated 2023-08-03) ยท 127 words

JSON - Lua Module

Intro ๊ฒฐ๋ก ์€ lua cjson์ด ๊ฐ€์žฅ ๋น ๋ฅด๋‹ค. ๊ทธ ๋‹ค์Œ์ด lunajson dkjson์€ ์ˆœ์ˆ˜ luaํŒŒ์ผ์ด๊ณ  ๋‹จ์ผ ํŒŒ์ผ์ด๋‹ค. ๋˜ ๋‹ค๋ฅธ ํ•˜๋‚˜๋Š” json.lua ์ด๋‹ค. ๋น ๋ฅด๋‹ค๊ณ  ํ•˜๋Š”๋ฐโ€ฆ ๋น„๊ต์  ์ตœ์‹ ์ด๋‹ค. cjson์€ ๋น ๋ฅด๋‚˜ ๋ชจ๋“ˆ ์ปดํŒŒ์ผ์ด ํ•„์š”ํ•˜๊ณ  lunajson์€ ๋‹ค์Œ์œผ๋กœ ๋น ๋ฅด๊ณ  ์ˆœ์ˆ˜ luaํŒŒ์ผ์ด์ง€๋งŒ ์—ฌ๋Ÿฌ ๊ฐœ์˜ ํŒŒ์ผ๋กœ ๋ถ„๋ฆฌ๋˜์–ด ์žˆ๋‹ค. dkjson์€ ์…‹ ์ค‘ ๊ฐ€์žฅ ํผํฌ๋จผ์Šค๊ฐ€ ๋‚ฎ์œผ๋‚˜ ๋‹จ์ผ ํŒŒ์ผ์ด๋‹ค. ์ƒํ™ฉ์— ๋”ฐ๋ผ ์ ์ ˆํžˆ ์‚ฌ์šฉํ•˜๋‹ค. Links https://github.com/grafi-tt/lunajson http://dkolf.de/src/dkjson-lua.fsl/home https://github.com/rxi/json.lua https://somedudesays.com/2019/12/using-json-with-lua

2022-11-07 ยท 55 words

CSV - Lua Module

ftcsv ์ถ”์ฒœ

2022-11-07 ยท 2 words

Json to sqlite3 import howto

Intro jsonํŒŒ์ผ์„ sqlite3์— importํ•˜๋Š” ๋ฐฉ๋ฒ• json -> csv -> sqlite3 ์ˆœ์„œ๋กœ ์ง„ํ–‰ํ•œ๋‹ค. jq, sqlite3๊ฐ€ ์‚ฌ์ „์— ์„ค์น˜๋˜์–ด ์žˆ์–ด์•ผ ํ•œ๋‹ค. jq๋Š” ๊ฒฝ๋Ÿ‰ ๋ช…๋ น๋ผ์ธ json ๊ด€๋ฆฌ ํ”„๋กœ๊ทธ๋žจ์ด๋‹ค. Requirement $ sudo apt install sqlite3 $ sudo apt install jq Getting the CSV $ cat data.json {"uri":"/","user_agent":"example1"} {"uri":"/foobar","user_agent":"example1"} {"uri":"/","user_agent":"example2"} {"uri":"/foobar","user_agent":"example3"} $ head -1 data.json | jq -r 'keys | @csv' "uri","user_agent" $ jq -r 'map(tostring) | @csv' < data.json "/","example1" "/foobar","example1" "/","example2" "/foobar","example3" $ % (head -1 data.json | jq -r 'keys | @csv' && jq -r 'map(tostring) | @csv' < data.json) > data.csv Loading it into sqlite3 $ sqlite3 somedata.db sqlite> .mode csv sqlite> .import data.csv my_table sqlite> select * from my_table where ... Links https://stackoverflow.com/questions/46407770/how-to-convert-a-json-file-to-an-sqlite-database ...

2022-11-07 ยท 112 words