<?xml version="1.0" encoding="utf-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
    <channel>
        <title>coco_hye.log</title>
        <link>https://velog.io/</link>
        <description></description>
        <lastBuildDate>Sun, 21 Nov 2021 05:57:57 GMT</lastBuildDate>
        <docs>https://validator.w3.org/feed/docs/rss2.html</docs>
        <generator>https://github.com/jpmonette/feed</generator>
        <image>
            <title>coco_hye.log</title>
            <url>https://images.velog.io/images/coco_hye/profile/9d68f71d-c696-4e7f-bfbf-1909e68de5bc/social.gif</url>
            <link>https://velog.io/</link>
        </image>
        <copyright>Copyright (C) 2019. coco_hye.log. All rights reserved.</copyright>
        <atom:link href="https://v2.velog.io/rss/coco_hye" rel="self" type="application/rss+xml"/>
        <item>
            <title><![CDATA[2. 프로젝트 개발]]></title>
            <link>https://velog.io/@coco_hye/2.-%ED%94%84%EB%A1%9C%EC%A0%9D%ED%8A%B8-%EA%B0%9C%EB%B0%9C</link>
            <guid>https://velog.io/@coco_hye/2.-%ED%94%84%EB%A1%9C%EC%A0%9D%ED%8A%B8-%EA%B0%9C%EB%B0%9C</guid>
            <pubDate>Sun, 21 Nov 2021 05:57:57 GMT</pubDate>
            <description><![CDATA[<h2 id="리파지토리-생성">리파지토리 생성</h2>
<h2 id="gitignore-설정">gitignore 설정</h2>
<p>gitignore 파일 설정 사이트 (<a href="https://url.kr/8mzhtv">https://url.kr/8mzhtv</a>) &gt; intellij,eclipse,gradle 옵션 추가</p>
<h2 id="new-project--spring-initializer">new Project : spring initializer</h2>
<p>spring boot는 spring framework를 빠르게 사용하기 위한 노력의 결과물입니다.
spring boot를 이용해서 기본구조를 빠르게 만들어서 쉽게 프로젝트를 시작하려고 합니다.</p>
<ol>
<li>인텔리 제이의 new project 버튼 클릭</li>
<li>프로젝트 <strong>파일</strong> 기본 설정<blockquote>
<p><img src="https://images.velog.io/images/coco_hye/post/927c5cdb-f3b4-4c70-bcf7-6ebf9aa0168d/%E1%84%89%E1%85%B3%E1%84%8F%E1%85%B3%E1%84%85%E1%85%B5%E1%86%AB%E1%84%89%E1%85%A3%E1%86%BA%202021-11-21%20%E1%84%8B%E1%85%A9%E1%84%92%E1%85%AE%202.29.51.png" alt=""></p>
</blockquote>
</li>
</ol>
<ul>
<li>프로젝트 종류<ul>
<li>Maven Project</li>
<li>Gradle Project</li>
</ul>
</li>
<li>개발 언어<ul>
<li>java</li>
<li>Kotlin</li>
<li>Groovy</li>
</ul>
</li>
<li>spring boot 버전</li>
<li>project meta data </li>
<li>dependencies<blockquote>
<p>프로젝트 생성시, 위 옵션항목별로 프로젝트 구성용도를 설명하자면,
: <strong>프로젝트의 종류, 개발언어, meta data의 패키징(Packaging)</strong>의 경우</p>
</blockquote>
</li>
<li><em>어떠한 것을 선택하느냐에 따라 *</em>
프로젝의 <strong>파일들의</strong> 이름이나 구조가 바뀝니다.<blockquote>
<p>: 하지만 <strong>나머지는</strong> 빌드툴(Maven/Gradle)의 설정파일(pom.xml/build.gradle)에 
내용이 기입되기 때문에 프로젝트 생성 후 변경해도 무방합니다.</p>
<blockquote>
<p>예시 : dependencies는 스프링 프레임워크에서 제공하는 라이브러리를 사용하기 위한 설정로직입니다. 프로젝트 생성시, 자동으로 빌드툴(Maven/Gradle)의 설정파일(pom.xml,gradle)에 라이브러디 다운로드를 위한 내용이 추가됩니다.</p>
</blockquote>
</blockquote>
</li>
</ul>
<p>참고 
<a href="https://url.kr/d9167z">https://url.kr/d9167z</a> : 프로젝트 생성 방법</p>
]]></description>
        </item>
        <item>
            <title><![CDATA[1. 프로젝트 설계]]></title>
            <link>https://velog.io/@coco_hye/%ED%94%84%EB%A1%9C%EC%A0%9D%ED%8A%B8-%EC%84%A4%EA%B3%84</link>
            <guid>https://velog.io/@coco_hye/%ED%94%84%EB%A1%9C%EC%A0%9D%ED%8A%B8-%EC%84%A4%EA%B3%84</guid>
            <pubDate>Sun, 21 Nov 2021 05:04:01 GMT</pubDate>
            <description><![CDATA[<ul>
<li>목차 리스트</li>
</ul>
<ul>
<li>상세 : 버전</li>
</ul>
<table>
<thead>
<tr>
<th align="center">버전</th>
<th align="center">날짜</th>
<th align="center">파일</th>
</tr>
</thead>
<tbody><tr>
<td align="center">0.1</td>
<td align="center"></td>
<td align="center"></td>
</tr>
</tbody></table>
]]></description>
        </item>
        <item>
            <title><![CDATA[11/9]]></title>
            <link>https://velog.io/@coco_hye/119</link>
            <guid>https://velog.io/@coco_hye/119</guid>
            <pubDate>Tue, 09 Nov 2021 06:26:51 GMT</pubDate>
            <description><![CDATA[<p>프로젝트
ㄴ BACK  : 
ㄴ FRONT : </p>
<ul>
<li>구현체 찾기
CMD + OPT + Click: Jump to Implementation
interface를 구현한 구현체들을 검색해서 이동</li>
</ul>
<ul>
<li>한글깨짐
인텔리제이 properties 파일에서 한글이 깨져서 나오는 경우가 있다.
이클립스 같은 경우에는 proerties 뷰어 플러그인을 설치해주면 되지만 인텔리제이에서는 설정만 바꿔주면 된다.
<img src="https://images.velog.io/images/coco_hye/post/d0e33368-3f01-4828-8e37-adeee7d1822e/image.png" alt=""></li>
</ul>
]]></description>
        </item>
        <item>
            <title><![CDATA[Mac Intellij 단축키]]></title>
            <link>https://velog.io/@coco_hye/Mac-Intellij-%EB%8B%A8%EC%B6%95%ED%82%A4</link>
            <guid>https://velog.io/@coco_hye/Mac-Intellij-%EB%8B%A8%EC%B6%95%ED%82%A4</guid>
            <pubDate>Wed, 20 Oct 2021 03:04:27 GMT</pubDate>
            <description><![CDATA[<h1 id="1-editing">1. Editing</h1>
<h2 id="1-1-한줄">1-1. 한줄</h2>
<blockquote>
<p>⌘D(Ctrl+D) : 라인 복제 (Duplicate current line)
⌘⌫(Ctrl+Y) : 라인 삭제 (Delete line at caret)
fn↑,fn↓(PageUp,PageDown): Page Up/Down
fn←,fn→(Home, End) : 라인 시작,끝으로 이동
fn⇧←,fn⇧→(Shift+Home,Shift+End) : 라인 전체 선택</p>
</blockquote>
<h2 id="1-2-단어별">1-2. 단어별</h2>
<blockquote>
<p>⌥↑,⌥↓(Ctrl+W,Shift+Ctrl+W) : 커서 근처의 코드 선택 영역을 확대하거나 축소합니다.
⌥←,⌥→(Ctrl+←,Ctrl+→) : 단어별 포커스 이동
⌥⇧←,⌥⇧→(Ctrl+Shift+←,Ctrl+Shift+→) : 단어별 선택</p>
</blockquote>
<hr>
<h1 id="2-compile-and-run">2. compile and Run</h1>
<p>컴파일(Compile) 및 실행(Run) 관련 주요 단축키 입니다.</p>
<blockquote>
<p>⌘F9(Ctrl + F9) : 프로젝트 빌드(Make project)
⌘R(Shift + F10) : 실행 (Run)<br>⌘d(Shift + F9): 디버그 (Debug)</p>
</blockquote>
<hr>
<h1 id="3-구조-search">3. 구조 search</h1>
<h2 id="3-1-method">3-1. Method</h2>
<blockquote>
<p>⌘B(Ctrl+B) : 해당 코드의 선언부로 이동.
⌘⌥B(Ctrl+Alt+B) : 해당 코드의 구현부로 이동.</p>
</blockquote>
<h2 id="3-2-method-계층">3-2. method 계층</h2>
<p>이제 현재 메서드를 구현하거나 재정의하는 클래스의 전체 계층 구조를 보려면 어떻게 해야 합니까?</p>
<h3 id="3-2-1-트리-뷰">3-2-1. 트리 뷰</h3>
<blockquote>
<p>⌘⌥H(Ctrl+Alt+H) : 클래스의 전체 계층 구조
⌘⌥U(Ctrl+Alt+U) : 클래스의 전체 계층 구조</p>
</blockquote>
<h3 id="3-2-2-트리뷰-시각화--다이어그램-">3-2-2. 트리뷰 시각화 ( 다이어그램 )</h3>
<blockquote>
<p>⌘⌥H(Ctrl+Alt+H) : 클래스의 전체 계층 구조</p>
</blockquote>
<h2 id="3-3-method-호출-계층">3-3. method 호출 계층</h2>
<blockquote>
<p>⌥F7(해당 객체 포커스 &gt;  Alt+F7) : 메소드를 호출하는 계층 구조
<img src="https://images.velog.io/images/coco_hye/post/ef59e0da-3fce-4b75-8642-cfac31a5558e/%E1%84%89%E1%85%B3%E1%84%8F%E1%85%B3%E1%84%85%E1%85%B5%E1%86%AB%E1%84%89%E1%85%A3%E1%86%BA%202021-10-20%20%E1%84%8B%E1%85%A9%E1%84%92%E1%85%AE%202.18.10.png" alt=""></p>
</blockquote>
<p>출처: <a href="https://ifuwanna.tistory.com/241">https://ifuwanna.tistory.com/241</a> [IfUwanna IT]
출처 : <a href="https://medium.com/@andrey_cheptsov/top-20-navigation-features-in-intellij-idea-ed8c17075880">https://medium.com/@andrey_cheptsov/top-20-navigation-features-in-intellij-idea-ed8c17075880</a></p>
]]></description>
        </item>
        <item>
            <title><![CDATA[입출력 기법 ( blocking I/o, Non-blocking i/o) ]]></title>
            <link>https://velog.io/@coco_hye/%EC%9E%85%EC%B6%9C%EB%A0%A5-%EA%B8%B0%EB%B2%95-blocking-Io-Non-blocking-io</link>
            <guid>https://velog.io/@coco_hye/%EC%9E%85%EC%B6%9C%EB%A0%A5-%EA%B8%B0%EB%B2%95-blocking-Io-Non-blocking-io</guid>
            <pubDate>Wed, 13 Oct 2021 09:48:13 GMT</pubDate>
            <description><![CDATA[<h1 id="1-학습-목표">1. 학습 목표</h1>
<ul>
<li>개발자의 기법에 대한 개발 기대점.</li>
<li>용어 차이점 이해 및 설명 삽가능.</li>
</ul>
<h1 id="2-프로그래밍-공통">2. 프로그래밍 (공통)</h1>
<ul>
<li>2.1. 공통 과정<ul>
<li>코드를 위에서 아래로 순차적 진행</li>
<li>한번에 한가지 사건만 발생.</li>
</ul>
</li>
</ul>
<h1 id="2-동기">2. 동기</h1>
<ul>
<li>동기 : 어떤 함수의 결과가 다른 함수가 끝나고 값을 산출할 때까지 대기하는 기법.</li>
</ul>
<h1 id="3-blocking">3. blocking</h1>
<h2 id="3-1-blocking">3-1. blocking</h2>
<ul>
<li>웹 앱이 브라우저에서 특정 코드를 실행하느라 브라우저에게 <strong>제어권을 돌려주지 않으면 브라우저는 마치 정지된 것처럼</strong> 보일 수 있습니다. 
이러한 <strong>현상을 blocking</strong> 이라고 부릅니다. <ul>
<li>어떤 함수의 결과가 다른 함수에 영향을 받는다면, 그 함수는 다른 함수가 끝나고 값을 산출할 때까지 기다려야합니다.
그리고 그 과정이 끝날 때 까지, <strong>유저의 입장에서 보자면, 전체 프로그앰이 멈춘거 같아보입니다.</strong></li>
</ul>
</li>
</ul>
<h2 id="3-2-blocking-예시-single-thread">3-2. blocking 예시 (single thread)</h2>
<ul>
<li><p>simple-sync.html</p>
<pre><code>const btn = document.querySelector(&#39;button&#39;);
btn.addEventListener(&#39;click&#39;, () =&gt; {
let myDate;
for(let i = 0; i &lt; 10000000; i++) {
  let date = new Date();
  myDate = date
}

console.log(myDate);

let pElem = document.createElement(&#39;p&#39;);
pElem.textContent = &#39;This is a newly-added paragraph.&#39;;
document.body.appendChild(pElem);
});
</code></pre></li>
</ul>
<ul>
<li><p>입력</p>
<ul>
<li><strong>하나의 버튼에 클릭 이벤트리스너를 지정하여 시간이 오래 걸리는 처리를 하도록하였습니다.</strong> (날짜를 천만번 계산하고 마지막에 콘솔에 날짜를 출력합니다.) 
그리고 처리가 끝나면 페이지에 간단한 문장을 한 줄 출력합니다. :</li>
</ul>
</li>
<li><p>출력</p>
<ul>
<li>2-1-출력1 : 콘솔 메세지가 매~우 느림.
이 예제를 실행할 때 JavaScript 콘솔을 열고 버튼을 클릭하면, <strong>콘솔에 메시지가 출력되기 전 까지 페이지에 문장이 나타나지 않는다는 것을 알 수 있습니다.</strong> 코드는 위에서 아래로 순차적으로 실행되며, 아래쪽 코드는 위쪽 코드의 처리가 끝날 때 까지 실행되지 않습니다.</li>
<li>2-1-출력2. 버튼 2번클릭시, 출력이 매~우 느림.
첫 번째 버튼을 클릭한 후 두 번째 버튼을 바로 클릭하면 경고 박스가 나타나지 않는 것을 확인할 수 있습니다. <strong>첫 번째 버튼은 이벤트가 끝나기 전 까지 다음 작동을 막아버립니다.</strong></li>
</ul>
</li>
<li><p>원인</p>
<ul>
<li>왜 이런 현상이 발생할까요? 답은 자바스크립트는 기본적으로 single threaded이기 때문입니다. 이 시점에서 threads의 개념을 소개할 필요가 있겠군요</li>
</ul>
</li>
</ul>
<br/>
<br/>

<hr>
<h1 id="3-3-threads">3-3. Threads</h1>
<h2 id="3-3-1-단일-프로세스">3-3-1. 단일 프로세스</h2>
<ul>
<li>Thread 는 기본적으로 프로그램이 작업을 완료하는데 사용할 수 있는 단일 프로세스 입니다. 각 스레드는 한 번에 하나의 작업만 수행할 수 있습니다. <ul>
<li>결과 : <blockquote>
<p>Task A --&gt; Task B --&gt; Task C</p>
</blockquote>
</li>
</ul>
</li>
</ul>
<h2 id="3-3-2-멀티-cpu-코어와-멀티-프로세스--">3-3-2. 멀티 CPU 코어와 멀티 프로세스  :</h2>
<ul>
<li><p>앞서 말했듯이, 많은 컴퓨터들이 현재 여러 개의 CPU코어를 가지고 있기 때문에, 한 번에 여러가지 일을 수행할 수 있습니다. 
Multiple thread를 지원하는 프로그래밍 언어는 멀티코어 컴퓨터의 CPU를 사용하여 여러 작업을 동시에 처리할 수 있습니다. </p>
</li>
<li><h3 id="효과--여러작업을-동시-처리">효과 : 여러작업을 동시 처리</h3>
</li>
<li><p>결과 : </p>
<blockquote>
<p>Thread 1: Task A --&gt; Task B
Thread 2: Task C --&gt; Task D</p>
</blockquote>
</li>
</ul>
<h2 id="3-3-3-javascript-is-single-threaded">3-3-3. JavaScript is single threaded</h2>
<p>자바스크립트는 전통적으로 싱글 thread입니다. 컴퓨터가 여러 개의 CPU를 가지고 있어도 main thread라 불리는 단일 thread에서만 작업을 실행할 수 있습니다. 위의 예시는 아래처럼 실행됩니다. :</p>
<h1 id="3-비동기">3. 비동기</h1>
<ul>
<li>비동기 : 호출한 함수가 바로 리턴해서 호출할,된 함수가 각각 작업에 착수.</li>
</ul>
<p>참고 
<a href="https://baek-kim-dev.site/38?category=897690">[카카오 면접] Blocking I/O, Syncronous Non-Blocking I/O, Asyncronous Non-Blocking I/O</a></p>
]]></description>
        </item>
        <item>
            <title><![CDATA[카카오 로그인과 싱크]]></title>
            <link>https://velog.io/@coco_hye/%EC%B9%B4%EC%B9%B4%EC%98%A4-%EB%A1%9C%EA%B7%B8%EC%9D%B8%EA%B3%BC-%EC%8B%B1%ED%81%AC</link>
            <guid>https://velog.io/@coco_hye/%EC%B9%B4%EC%B9%B4%EC%98%A4-%EB%A1%9C%EA%B7%B8%EC%9D%B8%EA%B3%BC-%EC%8B%B1%ED%81%AC</guid>
            <pubDate>Wed, 13 Oct 2021 06:48:55 GMT</pubDate>
            <description><![CDATA[<h1 id="카카오-로그인">카카오 로그인</h1>
<h1 id="카카오-싱크">카카오 싱크</h1>
<h2 id="차이점">차이점</h2>
<blockquote>
<p>상황1. 카카오 로그인과 카카오 싱크는 전혀 다른 건가요?
현재 저희 회사에서 운영하는 사이트(Web, 모바일Web, 모바일APP(하이브리드))에 카카오 로그인은 적용되어 있는데,
카카오 싱크를 적용하고자 할 경우 어떻게 해야 하는지 전혀 감을 잡지 못하고 있어 문의합니다.</p>
</blockquote>
<p>답변 &gt; 
카카오싱크는 카카오 소셜 로그인의 확장 스팩으로 이해.</p>
<p>1) 카카오 소셜 로그인으로 제한되는 &quot;사용자 의 개인정보를 추가로 제공 받을 수 있음&quot;.
2) 서비스 가입시, 서비스에서 받아야하는 약관을 카카오 동의창에 함께 노출.</p>
]]></description>
        </item>
        <item>
            <title><![CDATA[10월 업무일쥐 ( *ㅅ* )]]></title>
            <link>https://velog.io/@coco_hye/10%EC%9B%94-%EC%97%85%EB%AC%B4%EC%9D%BC%EC%A5%90-%E3%85%85</link>
            <guid>https://velog.io/@coco_hye/10%EC%9B%94-%EC%97%85%EB%AC%B4%EC%9D%BC%EC%A5%90-%E3%85%85</guid>
            <pubDate>Fri, 08 Oct 2021 10:16:13 GMT</pubDate>
            <description><![CDATA[<h1 id="스프링-가이드-뿌시기">스프링 가이드 뿌시기</h1>
<h2 id="목표-">목표 :</h2>
<ul>
<li>스프링 뿌시기.</li>
<li><strong>모듈 구현</strong>.</li>
<li>모듈 단위로 <strong>스프링 확장</strong>.</li>
</ul>
<h2 id="구성--계획">구성 : 계획</h2>
<ul>
<li>basic 34 : 3일</li>
<li>topical 3 : 2일 </li>
<li>tutorials 7 : 3일</li>
</ul>
<h3 id="211008">21.10.08</h3>
<p>  Building a RESTful Web Service
Learn how to create a RESTful web service with Spring.</p>
<p>Scheduling Tasks
Learn how to schedule tasks with Spring.</p>
<p>Consuming a RESTful Web Service
Learn how to retrieve web page data with Spring&#39;s RestTemplate.</p>
<p>Building Java Projects with Gradle
Learn how to build a Java project with Gradle.</p>
<p>Building Java Projects with Maven
Learn how to build a Java project with Maven.</p>
<p>Accessing Relational Data using JDBC with Spring
Learn how to access relational data with Spring.</p>
<p>Uploading Files
Learn how to build a Spring application that accepts multi-part file uploads.</p>
<p>Authenticating a User with LDAP
Learn how to secure an application with LDAP.</p>
<p>Messaging with Redis
Learn how to use Redis as a message broker.</p>
<p>Messaging with RabbitMQ
Learn how to create a simple publish-and-subscribe application with Spring and RabbitMQ.</p>
<p>Accessing Data with Neo4j
Learn how to persist objects and relationships in Neo4j&#39;s NoSQL data store.</p>
<p>Validating Form Input
Learn how to perform form validation with Spring.</p>
<p>Building a RESTful Web Service with Spring Boot Actuator
Learn how to create a RESTful Web service with Spring Boot Actuator.</p>
<p>Messaging with JMS
Learn how to publish and subscribe to messages using a JMS broker.</p>
<p>Creating a Batch Service
Learn how to create a basic batch-driven solution.</p>
<p>Securing a Web Application
Learn how to protect your web application with Spring Security.</p>
<p>Building a Hypermedia-Driven RESTful Web Service
Learn how to create a hypermedia-driven RESTful Web service with Spring.</p>
<p>Accessing Data in Pivotal GemFire
Learn how to build an application using Gemfire&#39;s data fabric.</p>
<p>Integrating Data
Learn how to build an application that uses Spring Integration to fetch data, process it, and write it to a file.</p>
<p>Caching Data with Pivotal GemFire
Learn how to cache data in GemFire.</p>
<p>Managing Transactions
Learn how to wrap key parts of code with transactions.</p>
<p>Accessing Data with JPA
Learn how to work with JPA data persistence using Spring Data JPA.</p>
<p>Accessing Data with MongoDB
Learn how to persist data in MongoDB.</p>
<p>Serving Web Content with Spring MVC
Learn how to create a web page with Spring MVC and Thymeleaf.</p>
<p>Converting a Spring Boot JAR Application to a WAR
Learn how to convert your Spring Boot JAR-based application to a WAR file.</p>
<p>Creating Asynchronous Methods
Learn how to create asynchronous service methods.</p>
<p>Handling Form Submission
Learn how to create and submit a web form with Spring.</p>
<p>Building an Application with Spring Boot
Learn how to build an application with minimal configuration.</p>
<p>Using WebSocket to build an interactive web application
Learn how to the send and receive messages between a browser and the server over a WebSocket</p>
<p>Working a Getting Started guide with STS
Learn how to import a Getting Started guide with Spring Tool Suite (STS).</p>
<p>Consuming a RESTful Web Service with AngularJS
Learn how to retrieve web page data with AngularJS.</p>
<p>Consuming a RESTful Web Service with jQuery
Learn how to retrieve web page data with jQuery.</p>
<p>Enabling Cross Origin Requests for a RESTful Web Service
Learn how to create a RESTful web service with Spring that support Cross-Origin Resource Sharing (CORS).</p>
<p>Consuming a SOAP web service
Learn how to create a client that consumes a WSDL-based service</p>
<p>Accessing JPA Data with REST
Learn how to work with RESTful, hypermedia-based data persistence using Spring Data REST.</p>
<p>Accessing Neo4j Data with REST
Learn how to work with RESTful, hypermedia-based data persistence using Spring Data REST.</p>
<p>Accessing MongoDB Data with REST
Learn how to work with RESTful, hypermedia-based data persistence using Spring Data REST.</p>
<p>Accessing Data in Pivotal GemFire with REST
Learn how to work with RESTful, hypermedia-based data persistence using Spring Data REST.</p>
<p>Producing a SOAP web service
Learn how to create a SOAP-based web service with Spring.</p>
<p>Caching Data with Spring
Learn how to cache data in memory with Spring</p>
<p>Deploying to Cloud Foundry from STS
Learn how to deploy a Spring application to Cloud Foundry from STS</p>
<p>Spring Boot with Docker
Learn how to create a Docker container from a Spring Boot application with Maven or Gradle</p>
<p>Working a Getting Started guide with IntelliJ IDEA
Learn how to work a Getting Started guide with IntelliJ IDEA.</p>
<p>Creating CRUD UI with Vaadin
Use Vaadin and Spring Data JPA to build a dynamic UI</p>
<p>Service Registration and Discovery
Learn how to register and find services with Eureka</p>
<p>Centralized Configuration
Learn how to manage application settings from an external, centralized source</p>
<p>Routing and Filtering
Learn how to route and filter requests to a microservice using Netflix Zuul</p>
<p>Testing the Web Layer
Learn how to test Spring Boot applications and MVC controllers.</p>
<p>Accessing data with MySQL
Learn how to set up and manage user accounts on MySQL and how to configure Spring Boot to connect to it at runtime.</p>
<p>Creating a Multi Module Project
Learn how to build a library and package it for consumption in a Spring Boot application</p>
<p>Creating API Documentation with Restdocs
Learn how to generate documentation for HTTP endpoints using Spring Restdocs</p>
<p>Messaging with Google Cloud Pub/Sub
Learn how to exchange messages using Spring Integration channel adapters and Google Cloud Pub/Sub</p>
<p>Building a Reactive RESTful Web Service
Learn how to create a RESTful web service with Reactive Spring and consume it with WebClient.</p>
<p>Consumer Driven Contracts
Learn how to with contract stubs and consuming that contract from another Spring application</p>
<p>Accessing Vault
Learn how to use Spring Vault to load secrets from HashiCorp Vault</p>
<p>Vault Configuration
Learn how to store and retrieve application configuration details in HashiCorp Vault</p>
<p>Accessing Data Reactively with Redis
Learn how to reactively interface with Redis and Spring Data</p>
<p>Deploying a Spring Boot app to Azure
Learn how to deploy a Spring Boot app to Azure.</p>
<p>Building a Gateway
Learn how to configure a gateway</p>
<p>Client-Side Load-Balancing with Spring Cloud LoadBalancer
Dynamically select correct instance for the request</p>
<p>Spring Cloud Stream
Learn how to build and test Spring Cloud Stream Applications with RabbitMQ and Apache Kafka</p>
<p>Spring Cloud Data Flow
Learn how to build, deploy and launch streaming and batch data pipelines using Spring Cloud Data Flow</p>
<p>Spring Cloud Task
Learn how to build and test Spring Cloud Task Applications</p>
<p>Spring Boot Kubernetes
Deploy a Spring Boot application to Kubernetes</p>
<p>Accessing data with R2DBC
Learn how to access relational data with the reactive protocol R2DBC</p>
<p>Spring Cloud Circuit Breaker Guide
How to Use Spring Cloud Circuit Breaker</p>
<p>Observability with Spring
Learn how to send application metrics to Tanzu Observability</p>
<p>Building a Guide with VS Code
Learn how to import and work with a Spring Getting Started Guide in VS Code.</p>
]]></description>
        </item>
        <item>
            <title><![CDATA[스프링부트와 도커 ( finally ) ]]></title>
            <link>https://velog.io/@coco_hye/%EC%8A%A4%ED%94%84%EB%A7%81%EB%B6%80%ED%8A%B8%EC%99%80-%EB%8F%84%EC%BB%A4-finally</link>
            <guid>https://velog.io/@coco_hye/%EC%8A%A4%ED%94%84%EB%A7%81%EB%B6%80%ED%8A%B8%EC%99%80-%EB%8F%84%EC%BB%A4-finally</guid>
            <pubDate>Fri, 08 Oct 2021 08:19:00 GMT</pubDate>
            <description><![CDATA[<h1 id="spring-boot-with-docker">Spring Boot with Docker</h1>
<h2 id="1-설계">1. 설계</h2>
<ol>
<li>이 가이드는 <strong>Spring Boot 애플리케이션을 실행</strong>하기 위한** Docker 이미지를 빌드**하는 프로세스를 안내 합니다. </li>
<li>우리는 기본으로 시작 <strong>Dockerfile</strong>하여 몇 가지 조정을 합니다. </li>
<li>그런 다음 .NET 대신 <strong>빌드 플러그인(Maven 및 Gradle용)</strong>을 사용하는 몇 가지 옵션을 보여줍니다 </li>
<li><strong>docker</strong>은 &quot;시작하기&quot; 가이드이므로 범위는 몇 가지 기본 요구 사항으로 제한됩니다. <strong>프로덕션용 컨테이너</strong> 이미지를 빌드하는 경우 고려해야 할 사항이 많고 짧은 가이드에서 모든 것을 다룰 수는 없습니다.</li>
</ol>
<br/>

<hr>
<h3 id="11-what-you-will-build">1.1. What You Will Build</h3>
<ul>
<li>Docker 는 사용자가 컨테이너 이미지를 게시하고 다른 사람이 게시한 이미지를 사용(<strong>consume those published by others.</strong>)할 수 있도록 하는 &quot;소셜&quot; 측면이 있는 Linux 컨테이너 관리 도구(<strong>Linux container management toolkit</strong>)입니다. </li>
<li>Docker 이미지는 컨테이너화된 프로세스를 실행하기 위한 레시피입니다. 이 가이드에서는 간단한 Spring 부트 애플리케이션용으로 빌드합니다.</li>
</ul>
<br/>

<hr>
<h3 id="1-2-what-you-will-need">1-2. What You Will Need</h3>
<p>필요 시간 </p>
<ul>
<li>About 15 minutes</li>
</ul>
<p>필요 기술</p>
<ul>
<li>A favorite text editor or IDE</li>
<li>JDK 1.8 or later</li>
<li>Gradle 4+ or Maven 3.2+</li>
<li>You can also import the code straight into your IDE:<ul>
<li>Spring Tool Suite (STS)</li>
<li>IntelliJ IDEA</li>
</ul>
</li>
</ul>
<p>필요 작업</p>
<ul>
<li><p>Linux 시스템을 사용하지 않는 경우 <strong>가상화된 서버가 필요</strong>합니다. 
ㄴ 1. VirtualBox를 설치하면 Mac과 같은 다른 도구에서 <strong>boot2docker</strong>원활하게 관리할 수 있습니다. 
ㄴ 2. VirtualBox의 다운로드 사이트를 방문 하여 컴퓨터의 버전을 선택하십시오. 다운로드하여 설치합니다. 
ㄴ 3. 실제로 실행하는 것에 대해 걱정하지 마십시오.</p>
</li>
<li><p><strong>64비트 머신에서만 실행되는 Docker 도 필요</strong> 합니다. 
ㄴ 1. 컴퓨터에 Docker를 설정하는 방법에 대한 자세한 내용은 <a href="https://docs.docker.com/installation/#installation">https://docs.docker.com/installation/#installation</a> 을 참조 하세요 .
ㄴ 2. 계속 진행하기 전에 <strong>docker쉘</strong>에서 명령을 실행할 수 있는지 확인하십시오 .
ㄴ 3. 프로세스를 사용하는 경우 <strong>먼저 boot2docker</strong> 실행해야 합니다</p>
</li>
</ul>
<br/>

<hr>
<h2 id="2-서버">2. 서버</h2>
<blockquote>
<p>목차</p>
</blockquote>
<ul>
<li>서버 : Spring Boot Application<ul>
<li>2-1. 서버 구성 : Spring Initializr</li>
<li>2-2. 서버 구현 : simple application &gt; restAPI </li>
</ul>
</li>
</ul>
<h3 id="2-1-서버-구성">2-1. 서버 구성</h3>
<ol>
<li><p><a href="https://start.spring.io%EB%A1%9C">https://start.spring.io로</a> 이동(<strong>Navigate to</strong>)합니다. 이 서비스는 애플리케이션에 필요한 모든 종속성(<strong>dependencies</strong>)을 가져오고 대부분의 <strong>설정을 자동으로 수행</strong>합니다.</p>
</li>
<li><p><strong>Gradle</strong> 또는 <strong>Maven과</strong> 사용하려는 언어를 선택합니다. 이 가이드에서는 Java를 선택했다고 가정합니다.</p>
</li>
<li><p>종속성(<strong>Dependencies</strong>)을 클릭 하고 <strong>Spring Web</strong> 을 선택하십시오.</p>
</li>
<li><p>생성(<strong>Generate</strong>) 을 클릭 합니다.</p>
</li>
<li><p>선택 사항으로 구성된(<strong>configured with your choices</strong>.) 웹 응용 프로그램의** 아카이브인** 결과 ZIP 파일을 다운로드합니다.</p>
</li>
</ol>
<blockquote>
<p>If your IDE has the Spring Initializr integration, you can complete this process from your IDE.</p>
</blockquote>
<blockquote>
<p>You can also fork the project from Github and open it in your IDE or other editor.</p>
</blockquote>
<br/>

<hr>
<h3 id="2-2-서버-구현--rest-api-logic">2-2. 서버 구현 &gt; Rest API logic</h3>
<p> Now you can create <strong>a simple application</strong>:</p>
<blockquote>
<p>src/main/java/hello/Application.java</p>
</blockquote>
<pre><code>package hello;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@SpringBootApplication
@RestController
public class Application {

  @RequestMapping(&quot;/&quot;)
  public String home() {
    return &quot;Hello Docker World&quot;;
  }

  public static void main(String[] args) {
    SpringApplication.run(Application.class, args);
  }

}</code></pre><ul>
<li><p><strong>코드 설명</strong> : </p>
<ul>
<li><p><strong>by Spring MVC to handle web requests.</strong>
The class is flagged as a <strong><em>@SpringBootApplication</em></strong> and as a <strong><em>@RestController</em></strong>, meaning that it is ready for use</p>
</li>
<li><p><strong><em>@RequestMapping</em> maps_</strong> /_ to the <em>home()</em> method, which sends a </p>
</li>
<li><p><strong>Hello World response.</strong></p>
</li>
<li><p>The <strong>main() method</strong> 
uses   Spring Boot’s <em>SpringApplication.run()</em> method to launch an application.</p>
</li>
</ul>
</li>
</ul>
<br/>

<h2 id="3-도커에-있는-애플리케이션-실행">3. 도커에 있는 애플리케이션 실행</h2>
<blockquote>
<ul>
<li>목차<ol start="3">
<li>도커 내 애플리케이션 실행 : run the application In docker
3-1. Docker os로 실행
3-2. Docker container로 실행</li>
</ol>
</li>
</ul>
</blockquote>
<h3 id="3-1-by-docker-os">3-1. by Docker os</h3>
<ul>
<li><p>실행 
Now we can run the application without the Docker container (that is, in the host OS):
이제 Docker 컨테이너 없이(즉, 호스트 OS에서) 애플리케이션을 실행할 수 있습니다.</p>
<ul>
<li>If you use <strong>Gradle</strong>, run the following command:
<code>./gradlew build &amp;&amp; java -jar build/libs/gs-spring-boot-docker-0.1.0.jar</code></li>
<li>If you use <strong>Maven</strong>, run the following command:
<code>./mvnw package &amp;&amp; java -jar target/gs-spring-boot-docker-0.1.0.jar</code></li>
</ul>
</li>
<li><p>출력
Then go to localhost:8080 to see your “Hello Docker World” message.</p>
</li>
</ul>
<br/>


<hr>
<h3 id="3-2-by-docker-container">3-2. by Docker container</h3>
<ul>
<li><p>*<em>step 3-2-1. 컨테이너화 ? *</em></p>
<ul>
<li><p>Docker에는 이미지의 &quot;계층&quot;을 지정( <strong>layers specify</strong> )하는 데 사용 하는 간단한 &quot;<strong>Dockerfile</strong>&quot; 파일 형식이 있습니다. </p>
</li>
<li><p>Spring Boot 프로젝트에서 다음 Dockerfile을 생성합니다. &gt; 아래 예제 1,2,3</p>
<br/>
</li>
</ul>
</li>
<li><p>** step 3-2-2. 컨테이너화를 위한 도커파일 생성 **</p>
<ul>
<li><p>*<em>1)  플러그인별, 기본 생성 *</em></p>
<ul>
<li>If you use <strong>Gradle</strong>, you can run it with the following command:
<code>docker build --build-arg JAR_FILE=build/libs/\*.jar -t springio/gs-spring-boot-docker</code>  </li>
<li>If you use <strong>Maven</strong>, you can run it with the following command: 
<code>docker build -t springio/gs-spring-boot-docker .</code></li>
</ul>
</li>
<li><p>** 2) ** 이 명령은 이미지를 빌드하고 로 태그를 지정(<strong>tags builds</strong>)합니다
<code>springio/gs-spring-boot-docker.</code></p>
</li>
</ul>
<blockquote>
<ul>
<li><strong>Command Form</strong></li>
</ul>
</blockquote>
<pre><code>FROM openjdk:8-jdk-alpine
ARG JAR_FILE=target/*.jar
COPY ${JAR_FILE} app.jar
ENTRYPOINT [&quot;java&quot;,&quot;-jar&quot;,&quot;/app.jar&quot;]</code></pre><blockquote>
<ul>
<li><strong>Command Attr</strong></li>
</ul>
</blockquote>
<ul>
<li>FROM :
이 Dockerfile은 매우 간단하지만 Java와 JAR 파일만 있으면( just Java and a JAR file ) 아무 장식 없이 Spring Boot 앱을 실행하는 데 필요한 모든 것입니다</li>
<li>ARG :
빌드는 애플리케이션을 실행할 스프링 사용자와 스프링 그룹을 생성합니다. </li>
<li>COPY :
그런 다음 app.jar로 실행되는 **컨테이너에 COPY 프로젝트에 JAR 파일을 복사 합니다.</li>
<li>ENTRYPOINT : 
ENTRYPOINT Java 프로세스를 래핑하는 셸이 없도록 Dockerfile의 배열 형식을 사용합니다. 
Docker에 대한 주제 가이드 는 이 주제에 대해 더 자세히 설명합니다.</li>
</ul>
<blockquote>
<p>To reduce Tomcat startup time, we used to add a system property pointing to /dev/urandom as a source of entropy. This is not necessary anymore with JDK 8 or later.</p>
</blockquote>
<blockquote>
<p>사용자 권한으로 애플리케이션을 실행하면 일부 위험을 완화하는 데 도움이 됩니다(see, for example,: StackExchange의 스레드 참조 ). 따라서 중요한 개선 사항 Dockerfile은 루트가 아닌 사용자로 응용 프로그램을 실행하는 것입니다.</p>
</blockquote>
</li>
</ul>
<br/>


<ul>
<li>** step 3-2-3. 출력 확인 ** </li>
</ul>
<blockquote>
<pre><code>FROM openjdk:8-jdk-alpine
RUN addgroup -S spring &amp;&amp; adduser -S spring -G spring
USER spring:spring
ARG JAR_FILE=target/*.jar
${JAR_FILE} app.jar
ENTRYPOINT [&quot;java&quot;,&quot;-jar&quot;,&quot;/app.jar&quot;]</code></pre></blockquote>
<pre><code>
-  ** 출력 확인 1) **
애플리케이션을 빌드하고 실행할 때 애플리케이션 시작 로그에서 **사용자 이름**을 볼 수 있습니다. </code></pre><pre><code>docker build -t springio/gs-spring-boot-docker .
docker run -p 8080:8080 springio/gs-spring-boot-docker </code></pre><pre><code>
-  ** 출력 확인 2)**
started by첫 번째 INFO로그 항목 에 유의하십시오 .
</code></pre><pre><code>:: Spring Boot ::        (v2.2.1.RELEASE)

2020-04-23 07:29:41.729  INFO 1 --- [main] hello.Application                        : Starting Application on b94c86e91cf9 with PID 1 (/app started by spring in /)
...</code></pre><pre><code>
- ** 4) 리팩토리 가능성 및 필요성**
    ㄴ 1. 또한 Spring Boot fat JAR 파일에는 **종속성과 애플리케이션 리소스가 명확하게 분리**되어 있으며 이 사실을 사용하여 성능을 개선할 수 있습니다. 핵심은 컨테이너 파일 시스템에 레이어를 만드는 것입니다. 
    ㄴ 2. 레이어는 빌드 시와 런타임(대부분의 런타임에서) 모두에 캐시되므로 **가장 자주 변경되는 리소스**(일반적으로 애플리케이션 자체의 클래스 및 **정적 리소스 static resources**)가 **더 느리게 변경되는 리소스 다음 에 레이어되기**를 원합니다 .
    ㄴ 3. 따라서 Dockerfile의 약간 다른 구현(**static resources**)을 사용합니다.

&lt;br/&gt;


- ** step 3-2-4. 도커 디렉토리의 위치와 네이밍 설정 **

  &gt; ```
FROM openjdk:8-jdk-alpine
RUN addgroup -S spring &amp;&amp; adduser -S spring -G spring
USER spring:spring
ARG DEPENDENCY=target/dependency
COPY ${DEPENDENCY}/BOOT-INF/lib /app/lib
COPY ${DEPENDENCY}/META-INF /app/META-INF
COPY ${DEPENDENCY}/BOOT-INF/classes /app
ENTRYPOINT [&quot;java&quot;,&quot;-cp&quot;,&quot;app:app/lib/*&quot;,&quot;hello.Application&quot;]</code></pre><ul>
<li><p><strong>1) ** 저장위치 지정
이 Dockerfile에는 DEPENDENCY지방 JAR의 압축을 푼 디렉토리를 가리키는 매개변수(</strong>pointing DEPENDENCY parameter**)가 있습니다.</p>
<blockquote>
<ul>
<li>부가 설명 1.<ol>
<li>If we get that right, it already contains a <strong>BOOT-INF/lib</strong> directory with the dependency JARs in it, and a <strong>BOOT-INF/classes</strong> directory with the application classes in it.</li>
<li>Notice that we use the application’s own main class: <strong>hello.Application</strong>. (This is faster than using the indirection provided by the fat JAR launcher.)
우리는 애플리케이션의 자체 메인 클래스를 사용합니다:
. (이는 팻 JAR 런처에서 제공하는 간접 참조를 사용하는 것보다 빠릅니다.)</li>
</ol>
</li>
</ul>
</blockquote>
</li>
<li><p>To use the DEPENDENCY parameter with <strong>Gradle</strong>, run the following command: 
<code>mkdir -p build/dependency &amp;&amp; (cd build/dependency; jar -xf ../libs/*.jar)</code> </p>
</li>
<li><p>To use the DEPENDENCY parameter with <strong>Maven</strong>, run the following command:
<code>mkdir -p target/dependency &amp;&amp; (cd target/dependency; jar -xf ../*.jar)</code></p>
</li>
</ul>
<blockquote>
<ul>
<li>의존성 주의사항 </li>
</ul>
<ol>
<li>Exploding the JAR file can <strong>result in the classpath order</strong> being different at runtime. A well-behaved and <strong>well-written</strong> application should not care about this, but you may see behavior changes if the <strong>dependencies</strong> are not <strong>carefully managed</strong>.<ol start="2">
<li>If you <strong>use boot2docker</strong>, you need to run it first <strong>before</strong> you do anything with the Docker command line or with the build tools (it runs a <strong>daemon process</strong> that handles the work for you in a virtual machine).</li>
</ol>
</li>
</ol>
</blockquote>
<ul>
<li><p><strong>step 3-2-4.</strong> 디렉토리명을 일컫는 디렉토리 매개변수 지정</p>
<ul>
<li>From a <strong>Gradle</strong> build, you need to add the explicit build arguments in the Docker command line:
<code>docker build --build-arg DEPENDENCY=build/dependency -t springio/gs-spring-boot-docker .</code></li>
<li>To build the image in <strong>Maven</strong>, you can use a simpler Docker command line: 
<code>docker build -t springio/gs-spring-boot-docker .</code></li>
</ul>
<blockquote>
<p>Of course, if you use only Gradle, you could change the Dockerfile to make the default value of DEPENDENCY match the location of the unpacked archive.</p>
</blockquote>
</li>
</ul>
<ul>
<li><p>** step 3-2-5. 고도화 히스토리 **</p>
<ol>
<li><strong>Docker 명령줄을 사용하여 빌드</strong>하는 대신 <strong>빌드 플러그인을 사용</strong>할 수 있습니다. 
ㄴ Spring Boot는 자체 빌드 플러그인을 사용하여 Maven 또는 Gradle에서 컨테이너 빌드를 지원합니다. </li>
<li>Google 에는 Maven 및 Gradle 플러그인이 포함된 <strong>Jib 이라는 오픈 소스 도구</strong>도 있습니다. 
ㄴ 아마도 이 <strong>접근 방식</strong>에서 가장 흥미로운 점은 <strong>Dockerfile을 필요로 하지않습니다</strong>. 
docker build 에서 가져온 것과 동일한 표준 컨테이너 형식을 사용하여 이미지를 빌드할 수 있습니다 
ㄴ 또한 <strong>도커가 설치되지 않은 환경에서도</strong> 작동할 수 있습니다(빌드 서버에서는 일반적이지 않음).</li>
</ol>
<blockquote>
<p>By default, the images generated by the default buildpacks do not run your application as root. Check the configuration guide for Gradle or Maven for how to change the default settings.</p>
</blockquote>
</li>
<li><ul>
<li>기본적으로 기본 빌드팩에서 생성된 이미지는 애플리케이션을 루트로 실행하지 않습니다.**  기본 설정을 변경하는 방법 은 Gradle 또는 Maven 의 구성 가이드를 확인하세요 .</li>
</ul>
</li>
</ul>
<br/>

<hr>
<h2 id="4-도커-이미지로-빌드">4. 도커 이미지로 빌드</h2>
<p>( Build a Docker Image with Gradle ) </p>
<ul>
<li><strong>step 4-1. Gradle로 Docker 이미지 빌드</strong><ul>
<li>You can build a tagged <strong>docker</strong> image with <strong>Gradle</strong> in one command:
<code>./gradlew bootBuildImage --imageName=springio/gs-spring-boot-docker</code></li>
<li>Build a <strong>Docker</strong> Image with <strong>Maven</strong>
빠르게 시작하려면 다음을 변경하지 않고 Spring Boot 이미지 생성기를 실행할 수 있습니다 <strong>pom.xml</strong>( Dockerfile, 여전히 있는 경우 무시됨).
<code>./mvnw spring-boot:build-image -Dspring-boot.build-image.imageName=springio/gs-spring-boot-docker</code></li>
</ul>
</li>
</ul>
<br/>

<hr>
<h2 id="5-도커-이미지-실행">5. 도커 이미지 실행</h2>
<h3 id="51-by-docker-os">5.1. by Docker OS</h3>
<ul>
<li><p><strong>To push to a Docker registry *<em>, 
1) you need to have *</em>permission to push</strong>, which you do not have by default.
Docker 레지스트리에 푸시하려면 기본적으로 없는 푸시 권한이 있어야 합니다.
2) Change the <strong>image prefix</strong> to your own Dockerhub ID and <strong>docker login</strong> to make sure you are authenticated before you run Docker.
이미지 접두사를 고유한 Dockerhub ID로 변경하고 docker loginDocker를 실행하기 전에 인증되었는지 확인하십시오.</p>
<ul>
<li>*<em>step 1 . 도커에 푸쉬 *</em>
이미지 접두사를 고유한 Dockerhub ID로 변경하고 docker loginDocker를 실행하기 전에 인증되었는지 확인하십시오.</li>
</ul>
<ol>
<li>docker push 예제는 실패합니다 (Dockerhub의 &quot;springio&quot; 조직에 속하지 않는 한).  </li>
<li>그러나 자신의 도커 ID와 일치하도록 구성을 변경하면 성공해야 합니다. 
그러면 새로운 태그가 지정되고 배포된 이미지가 생성됩니다.</li>
<li><strong>로컬로 빌드된 도커 이미지</strong>를 실행하기 위해 도커에 등록하거나 아무 것도 게시할 필요가 없습니다. </li>
<li>Docker로 빌드한 경우 (명령줄 또는 Spring Boot에서) 여전히 로컬로 태그가 지정된 이미지가 있으며 <strong>다음과 같이 실행</strong>할 수 있습니다.</li>
</ol>
<ul>
<li>명령 
<code>$ docker run -p 8080:8080 -t springio/gs-spring-boot-docker</code></li>
<li>출력<pre><code>Container memory limit unset. Configuring JVM for 1G container.
Calculated JVM Memory Configuration: -XX:MaxDirectMemorySize=10M -XX:MaxMetaspaceSize=86381K -XX:ReservedCodeCacheSize=240M -Xss1M -Xmx450194K (Head Room: 0%, Loaded Class Count: 12837, Thread Count: 250, Total Memory: 1073741824)
.... 
2015-03-31 13:25:48.035  INFO 1 --- [           main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat started on port(s): 8080 (http)
  2015-03-31 13:25:48.037  INFO 1 --- [           main] hello.Application                        : Started Application in 5.613 seconds (JVM running for 7.293)  </code></pre><blockquote>
<p>The CF memory calculator is used at runtime to size the JVM to fit the container.
CF 메모리 계산기는 런타임에 컨테이너에 맞게 JVM의 크기를 조정하는 데 사용됩니다.</p>
</blockquote>
</li>
</ul>
</li>
</ul>
<ul>
<li><p><strong>step 2. 출력 확인</strong> :</p>
<ul>
<li><strong>step 2-1. 기본 출력 확인</strong> :
The application is then available on <strong><a href="http://localhost:8080">http://localhost:8080</a></strong> (visit that and it says, “Hello Docker World”).
그런 다음 애플리케이션은 <a href="http://localhost:8080">http://localhost:8080</a> 에서 사용할 수 있습니다 (방문하면 &quot;Hello Docker World&quot;라고 표시됨).</li>
</ul>
<blockquote>
<ul>
<li>** step 2. 번외 출력 :** </li>
</ul>
</blockquote>
<ul>
<li>boot2docker가 있는 Mac을 사용하는 경우, 일반적으로 시작 시 다음과 같이 표시됩니다 :  <code>Docker client to the Docker daemon, please set:
export DOCKER_CERT_PATH=/Users/gturnquist/.boot2docker/certs/boot2docker-vm
export DOCKER_TLS_VERIFY=1
export DOCKER_HOST=tcp://192.168.59.103:2376</code> </li>
<li>애플리케이션을 보려면 localhost 대신 DOCKER_HOST의 IP 주소를 방문해야 합니다. 이 경우 VM의 공개 IP인 <a href="https://192.168.59.103:8080%EC%9D%84">https://192.168.59.103:8080을</a> 방문해야 합니다 .</li>
</ul>
<ul>
<li><p>** step 2-1. 실행 중일 때, 출력 예시**</p>
<pre><code>$ docker ps
CONTAINER ID        IMAGE                                   COMMAND                  CREATED             STATUS              PORTS                    NAMES
81c723d22865        springio/gs-spring-boot-docker:latest   &quot;java -Djava.secur...&quot;   34 seconds ago      Up 33 seconds       0.0.0.0:8080-&gt;8080/tcp   goofy_brown  ```</code></pre></li>
<li><p><strong>step 2-2. 컨테이너 ID로 종료 명령.</strong>  </p>
<pre><code>docker stop goofy_brown 
81c723d22865 </code></pre></li>
<li><p>*<em>step2-3. 컨테이너 삭제. *</em>
(/var/lib/docker작업이 끝나면 컨테이너를 삭제할 수도 있습니다. 파일 시스템 어딘가에 유지됨).
<code>docker rm goofy_brown</code></p>
</li>
</ul>
</li>
</ul>
<br/>

<hr>
<h3 id="5-2-by-spring-profiles">5-2. by Spring Profiles</h3>
<ul>
<li><strong>step 1. 프로파일 환경설정 및  프로파일로 실행 **
Spring 프로필로 새로 생성된 Docker 이미지를 실행하는 것은 **환경 변수를 Docker 실행 명령</strong>( prod프로필용)에 전달하는 것만큼 쉽습니다 .<ul>
<li>You can do the same for the <strong>prod profile</strong>:
<code>docker run -e &quot;SPRING_PROFILES_ACTIVE=prod&quot; -p 8080:8080 -t springio/gs-spring-boot-docker</code></li>
<li>You can do the same for the <strong>dev profile</strong>:
<code>docker run -e &quot;SPRING_PROFILES_ACTIVE=dev&quot; -p 8080:8080 -t springio/gs-spring-boot-docker</code></li>
</ul>
</li>
</ul>
<br/>

<hr>
<h2 id="6-디버깅">6. 디버깅</h2>
<ul>
<li><strong>step 7-1.  도커에 있는 애플리케이션 디버깅 ( Debugging the Application in a Docker Container) **
애플리케이션을 디버그하려면 **JPDA Transport</strong>를 사용할 수 있습니다 . 컨테이너를 원격 서버처럼 취급(<strong>remote server treat</strong>)합니다. 
ㄴ 이 기능을 활성화하려면 <strong>JAVA_OPTS</strong>변수 에 Java 에이전트 설정을 전달 하고 컨테이너 실행 중에 에이전트의 포트를 localhost에 매핑합니다.
ㄴ Mac용 Docker를 사용하면 블랙 매직 사용 없이 IP로 컨테이너에 액세스할 수 없기 때문에 제한이 있습니다.(<strong>lack magic usage</strong>) <ul>
<li><code>docker run -e &quot;JAVA_TOOL_OPTIONS=-agentlib:jdwp=transport=dt_socket,address=5005,server=y,suspend=n&quot; -p 8080:8080 -p 5005:5005 -t springio/gs-spring-boot-docker</code></li>
</ul>
</li>
</ul>
<h2 id="7-summary">7. Summary</h2>
<p>Congratulations!</p>
<ul>
<li>You have created a Docker container for a Spring Boot application!</li>
<li>By default, Spring Boot 애플리케이션은 컨테이너 내부의 포트 8080에서 실행되며 </li>
<li>-p명령줄에서 를 사용하여 호스트의 동일한 포트에 매핑했습니다 .</li>
</ul>
<h1 id="see-also">See Also</h1>
<p>다음 가이드도 도움이 될 수 있습니다.</p>
<ul>
<li><p>Spring MVC로 웹 콘텐츠 제공</p>
</li>
<li><p>스프링 부트로 애플리케이션 빌드</p>
</li>
<li><p>Docker를 사용한 Spring Boot에 대한 주제 가이드 (이 가이드보다 더 깊이 있음)</p>
</li>
</ul>
]]></description>
        </item>
        <item>
            <title><![CDATA[스프링부트와 도커]]></title>
            <link>https://velog.io/@coco_hye/docker1</link>
            <guid>https://velog.io/@coco_hye/docker1</guid>
            <pubDate>Thu, 07 Oct 2021 14:00:41 GMT</pubDate>
            <description><![CDATA[<h1 id="spring-boot-with-docker">Spring Boot with Docker</h1>
<ol>
<li>이 가이드는 <strong>Spring Boot 애플리케이션을 실행</strong>하기 위한** Docker 이미지를 빌드**하는 프로세스를 안내 합니다. </li>
<li>우리는 기본으로 시작 <strong>Dockerfile</strong>하여 몇 가지 조정을 합니다. </li>
<li>그런 다음 .NET 대신 <strong>빌드 플러그인(Maven 및 Gradle용)</strong>을 사용하는 몇 가지 옵션을 보여줍니다 </li>
<li><strong>docker</strong>은 &quot;시작하기&quot; 가이드이므로 범위는 몇 가지 기본 요구 사항으로 제한됩니다. <strong>프로덕션용 컨테이너</strong> 이미지를 빌드하는 경우 고려해야 할 사항이 많고 짧은 가이드에서 모든 것을 다룰 수는 없습니다.</li>
</ol>
<br/>

<hr>
<h2 id="1-what-you-will-build">1. What You Will Build</h2>
<ul>
<li>Docker 는 사용자가 컨테이너 이미지를 게시하고 다른 사람이 게시한 이미지를 사용(<strong>consume those published by others.</strong>)할 수 있도록 하는 &quot;소셜&quot; 측면이 있는 Linux 컨테이너 관리 도구(<strong>Linux container management toolkit</strong>)입니다. </li>
<li>Docker 이미지는 컨테이너화된 프로세스를 실행하기 위한 레시피입니다. 이 가이드에서는 간단한 Spring 부트 애플리케이션용으로 빌드합니다.</li>
</ul>
<br/>

<hr>
<h2 id="2-what-you-will-need">2. What You Will Need</h2>
<p>필요 시간 </p>
<ul>
<li>About 15 minutes</li>
</ul>
<p>필요 기술</p>
<ul>
<li>A favorite text editor or IDE</li>
<li>JDK 1.8 or later</li>
<li>Gradle 4+ or Maven 3.2+</li>
<li>You can also import the code straight into your IDE:<ul>
<li>Spring Tool Suite (STS)</li>
<li>IntelliJ IDEA</li>
</ul>
</li>
</ul>
<p>필요 작업</p>
<ul>
<li><p>Linux 시스템을 사용하지 않는 경우 <strong>가상화된 서버가 필요</strong>합니다. 
ㄴ 1. VirtualBox를 설치하면 Mac과 같은 다른 도구에서 <strong>boot2docker</strong>원활하게 관리할 수 있습니다. 
ㄴ 2. VirtualBox의 다운로드 사이트를 방문 하여 컴퓨터의 버전을 선택하십시오. 다운로드하여 설치합니다. 
ㄴ 3. 실제로 실행하는 것에 대해 걱정하지 마십시오.</p>
</li>
<li><p><strong>64비트 머신에서만 실행되는 Docker 도 필요</strong> 합니다. 
ㄴ 1. 컴퓨터에 Docker를 설정하는 방법에 대한 자세한 내용은 <a href="https://docs.docker.com/installation/#installation">https://docs.docker.com/installation/#installation</a> 을 참조 하세요 .
ㄴ 2. 계속 진행하기 전에 <strong>docker쉘</strong>에서 명령을 실행할 수 있는지 확인하십시오 .
ㄴ 3. 프로세스를 사용하는 경우 <strong>먼저 boot2docker</strong> 실행해야 합니다</p>
</li>
</ul>
<br/>

<hr>
<h2 id="3-starting-with-spring-initializr">3. Starting with Spring Initializr</h2>
<p>프로젝트를 초기화하려면:</p>
<ol>
<li><p><a href="https://start.spring.io%EB%A1%9C">https://start.spring.io로</a> 이동(<strong>Navigate to</strong>)합니다. 이 서비스는 애플리케이션에 필요한 모든 종속성(<strong>dependencies</strong>)을 가져오고 대부분의 <strong>설정을 자동으로 수행</strong>합니다.</p>
</li>
<li><p><strong>Gradle</strong> 또는 <strong>Maven과</strong> 사용하려는 언어를 선택합니다. 이 가이드에서는 Java를 선택했다고 가정합니다.</p>
</li>
<li><p>종속성(<strong>Dependencies</strong>)을 클릭 하고 <strong>Spring Web</strong> 을 선택하십시오.</p>
</li>
<li><p>생성(<strong>Generate</strong>) 을 클릭 합니다.</p>
</li>
<li><p>선택 사항으로 구성된(<strong>configured with your choices</strong>.) 웹 응용 프로그램의** 아카이브인** 결과 ZIP 파일을 다운로드합니다.</p>
</li>
</ol>
<blockquote>
<p>If your IDE has the Spring Initializr integration, you can complete this process from your IDE.</p>
</blockquote>
<blockquote>
<p>You can also fork the project from Github and open it in your IDE or other editor.</p>
</blockquote>
<br/>

<hr>
<h2 id="4-set-up-a-spring-boot-application">4. Set up a Spring Boot Application</h2>
<h3 id="41-simple-application">4.1. simple application</h3>
<p> Now you can create <strong>a simple application</strong>:</p>
<blockquote>
<p>src/main/java/hello/Application.java</p>
</blockquote>
<pre><code>package hello;

import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@SpringBootApplication
@RestController
public class Application {

  @RequestMapping(&quot;/&quot;)
  public String home() {
    return &quot;Hello Docker World&quot;;
  }

  public static void main(String[] args) {
    SpringApplication.run(Application.class, args);
  }

}</code></pre><ul>
<li><p><strong>코드 설명</strong> : </p>
<ul>
<li><p><strong>by Spring MVC to handle web requests.</strong>
The class is flagged as a <strong><em>@SpringBootApplication</em></strong> and as a <strong><em>@RestController</em></strong>, meaning that it is ready for use</p>
</li>
<li><p><strong><em>@RequestMapping</em> maps_</strong> /_ to the <em>home()</em> method, which sends a </p>
</li>
<li><p><strong>Hello World response.</strong></p>
</li>
<li><p>The <strong>main() method</strong> 
uses   Spring Boot’s <em>SpringApplication.run()</em> method to launch an application.</p>
</li>
</ul>
</li>
</ul>
<br/>

<h3 id="42-run-the-application">4.2. run the application</h3>
<ul>
<li><p>실행 
Now we can run the application without the Docker container (that is, in the host OS):
이제 Docker 컨테이너 없이(즉, 호스트 OS에서) 애플리케이션을 실행할 수 있습니다.</p>
<ul>
<li>If you use <strong>Gradle</strong>, run the following command:
<code>./gradlew build &amp;&amp; java -jar build/libs/gs-spring-boot-docker-0.1.0.jar</code></li>
<li>If you use <strong>Maven</strong>, run the following command:
<code>./mvnw package &amp;&amp; java -jar target/gs-spring-boot-docker-0.1.0.jar</code></li>
</ul>
</li>
<li><p>출력
Then go to localhost:8080 to see your “Hello Docker World” message.</p>
</li>
</ul>
<br/>


<hr>
<h2 id="5-containerize-it-컨테이너화">5. Containerize It (컨테이너화)</h2>
<ul>
<li><p>컨테이너화</p>
<ul>
<li>Docker에는 이미지의 &quot;계층&quot;을 지정( <strong>layers specify</strong> )하는 데 사용 하는 간단한 &quot;<strong>Dockerfile</strong>&quot; 파일 형식이 있습니다. </li>
<li>Spring Boot 프로젝트에서 다음 Dockerfile을 생성합니다.</li>
</ul>
<br/>

</li>
</ul>
<h3 id="example-1-dockerfile">Example 1. Dockerfile</h3>
<blockquote>
<ul>
<li><strong>Command Form</strong></li>
</ul>
</blockquote>
<pre><code>FROM openjdk:8-jdk-alpine
ARG JAR_FILE=target/*.jar
COPY ${JAR_FILE} app.jar
ENTRYPOINT [&quot;java&quot;,&quot;-jar&quot;,&quot;/app.jar&quot;]</code></pre><ul>
<li><p><strong>속성</strong>
```</p>
</li>
<li><ol>
<li>FROM :
ㄴ 이 Dockerfile은 매우 간단하지만 Java와 JAR 파일만 있으면( just Java and a JAR file ) 아무 장식 없이 Spring Boot 앱을 실행하는 데 필요한 모든 것입니다</li>
</ol>
</li>
<li><ol start="2">
<li>ARG :
ㄴ 빌드는 애플리케이션을 실행할 스프링 사용자와 스프링 그룹을 생성합니다. </li>
</ol>
</li>
<li><ol start="3">
<li>COPY :
ㄴ 그런 다음 app.jar로 실행되는 **컨테이너에 COPY 프로젝트에 JAR 파일을 복사 합니다.</li>
</ol>
</li>
<li><ol start="4">
<li>ENTRYPOINT : 
ㄴ ENTRYPOINT Java 프로세스를 래핑하는 셸이 없도록 Dockerfile의 배열 형식을 사용합니다. 
Docker에 대한 주제 가이드 는 이 주제에 대해 더 자세히 설명합니다.<pre><code></code></pre></li>
</ol>
</li>
<li><p>** step1-1. 플러그인별 컨테이너화 명령**</p>
<ul>
<li>If you use <strong>Gradle</strong>, you can run it with the following command:
<code>docker build --build-arg JAR_FILE=build/libs/\*.jar -t springio/gs-spring-boot-docker</code>  </li>
<li>If you use <strong>Maven</strong>, you can run it with the following command: 
<code>docker build -t springio/gs-spring-boot-docker .</code></li>
</ul>
</li>
<li><p><strong>step1-2.</strong> 이 명령은 이미지를 빌드하고 로 태그를 지정(<strong>tags builds</strong>)합니다
<code>springio/gs-spring-boot-docker.</code></p>
</li>
</ul>
<blockquote>
<p>To reduce Tomcat startup time, we used to add a system property pointing to /dev/urandom as a source of entropy. This is not necessary anymore with JDK 8 or later.</p>
</blockquote>
<blockquote>
<p>사용자 권한으로 애플리케이션을 실행하면 일부 위험을 완화하는 데 도움이 됩니다(see, for example,: StackExchange의 스레드 참조 ). 따라서 중요한 개선 사항 Dockerfile은 루트가 아닌 사용자로 응용 프로그램을 실행하는 것입니다.</p>
</blockquote>
<br/>

<h3 id="example-2-dockerfile">Example 2. Dockerfile</h3>
<blockquote>
<pre><code>FROM openjdk:8-jdk-alpine
RUN addgroup -S spring &amp;&amp; adduser -S spring -G spring
USER spring:spring
ARG JAR_FILE=target/*.jar
${JAR_FILE} app.jar
ENTRYPOINT [&quot;java&quot;,&quot;-jar&quot;,&quot;/app.jar&quot;]</code></pre></blockquote>
<pre><code>
-  ** step 2-1-1. 출력 확인 **
애플리케이션을 빌드하고 실행할 때 애플리케이션 시작 로그에서 **사용자 이름**을 볼 수 있습니다. </code></pre><pre><code>docker build -t springio/gs-spring-boot-docker .
docker run -p 8080:8080 springio/gs-spring-boot-docker </code></pre><pre><code>
-  ** step 2-1-2. 출력 확인 **
started by첫 번째 INFO로그 항목 에 유의하십시오 .
</code></pre><pre><code>:: Spring Boot ::        (v2.2.1.RELEASE)

2020-04-23 07:29:41.729  INFO 1 --- [main] hello.Application                        : Starting Application on b94c86e91cf9 with PID 1 (/app started by spring in /)
...</code></pre><pre><code>
- **리팩토리 가능성 및 필요성**
    ㄴ 1. 또한 Spring Boot fat JAR 파일에는 **종속성과 애플리케이션 리소스가 명확하게 분리**되어 있으며 이 사실을 사용하여 성능을 개선할 수 있습니다. 핵심은 컨테이너 파일 시스템에 레이어를 만드는 것입니다. 
    ㄴ 2. 레이어는 빌드 시와 런타임(대부분의 런타임에서) 모두에 캐시되므로 **가장 자주 변경되는 리소스**(일반적으로 애플리케이션 자체의 클래스 및 **정적 리소스 static resources**)가 **더 느리게 변경되는 리소스 다음 에 레이어되기**를 원합니다 .
    ㄴ 3. 따라서 Dockerfile의 약간 다른 구현(**static resources**)을 사용합니다.

&lt;br/&gt;


### Example 3. Dockerfile

&gt; ```
FROM openjdk:8-jdk-alpine
RUN addgroup -S spring &amp;&amp; adduser -S spring -G spring
USER spring:spring
ARG DEPENDENCY=target/dependency
COPY ${DEPENDENCY}/BOOT-INF/lib /app/lib
COPY ${DEPENDENCY}/META-INF /app/META-INF
COPY ${DEPENDENCY}/BOOT-INF/classes /app
ENTRYPOINT [&quot;java&quot;,&quot;-cp&quot;,&quot;app:app/lib/*&quot;,&quot;hello.Application&quot;]</code></pre><ul>
<li><p><strong>step 3-1.</strong> 저장위치 지정
이 Dockerfile에는 DEPENDENCY지방 JAR의 압축을 푼 디렉토리를 가리키는 매개변수(<strong>pointing DEPENDENCY parameter</strong>)가 있습니다.</p>
<blockquote>
<ul>
<li>부가 설명 1.<ol>
<li>If we get that right, it already contains a <strong>BOOT-INF/lib</strong> directory with the dependency JARs in it, and a <strong>BOOT-INF/classes</strong> directory with the application classes in it.</li>
<li>Notice that we use the application’s own main class: <strong>hello.Application</strong>. (This is faster than using the indirection provided by the fat JAR launcher.)
우리는 애플리케이션의 자체 메인 클래스를 사용합니다:
. (이는 팻 JAR 런처에서 제공하는 간접 참조를 사용하는 것보다 빠릅니다.)</li>
</ol>
</li>
</ul>
</blockquote>
<ul>
<li>To use the DEPENDENCY parameter with <strong>Gradle</strong>, run the following command: 
<code>mkdir -p build/dependency &amp;&amp; (cd build/dependency; jar -xf ../libs/*.jar)</code> </li>
<li>To use the DEPENDENCY parameter with <strong>Maven</strong>, run the following command:
<code>mkdir -p target/dependency &amp;&amp; (cd target/dependency; jar -xf ../*.jar)</code></li>
</ul>
</li>
</ul>
<br/>

<blockquote>
<ul>
<li>의존성 주의사항 <ol>
<li>Exploding the JAR file can <strong>result in the classpath order</strong> being different at runtime. A well-behaved and <strong>well-written</strong> application should not care about this, but you may see behavior changes if the <strong>dependencies</strong> are not <strong>carefully managed</strong>.</li>
<li>If you <strong>use boot2docker</strong>, you need to run it first <strong>before</strong> you do anything with the Docker command line or with the build tools (it runs a <strong>daemon process</strong> that handles the work for you in a virtual machine).</li>
</ol>
</li>
</ul>
</blockquote>
<ul>
<li><strong>step 3-2.</strong> 디렉토리 매개변수 지정 <ul>
<li>From a <strong>Gradle</strong> build, you need to add the explicit build arguments in the Docker command line:
<code>docker build --build-arg DEPENDENCY=build/dependency -t springio/gs-spring-boot-docker .</code></li>
<li>To build the image in <strong>Maven</strong>, you can use a simpler Docker command line: 
<code>docker build -t springio/gs-spring-boot-docker .</code></li>
</ul>
</li>
</ul>
<blockquote>
<p>Of course, if you use only Gradle, you could change the Dockerfile to make the default value of DEPENDENCY match the location of the unpacked archive.</p>
</blockquote>
<ul>
<li><strong>Docker 명령줄을 사용하여 빌드</strong>하는 대신 <strong>빌드 플러그인을 사용</strong>할 수 있습니다. 
ㄴ Spring Boot는 자체 빌드 플러그인을 사용하여 Maven 또는 Gradle에서 컨테이너 빌드를 지원합니다. </li>
<li>Google 에는 Maven 및 Gradle 플러그인이 포함된 <strong>Jib 이라는 오픈 소스 도구</strong>도 있습니다. 
ㄴ 아마도 이 <strong>접근 방식</strong>에서 가장 흥미로운 점은 <strong>Dockerfile을 필요로 하지않습니다</strong>. 
docker build 에서 가져온 것과 동일한 표준 컨테이너 형식을 사용하여 이미지를 빌드할 수 있습니다 
ㄴ 또한 <strong>도커가 설치되지 않은 환경에서도</strong> 작동할 수 있습니다(빌드 서버에서는 일반적이지 않음).</li>
</ul>
<blockquote>
<p>By default, the images generated by the default buildpacks do not run your application as root. Check the configuration guide for Gradle or Maven for how to change the default settings.
** 기본적으로 기본 빌드팩에서 생성된 이미지는 애플리케이션을 루트로 실행하지 않습니다.**  기본 설정을 변경하는 방법 은 Gradle 또는 Maven 의 구성 가이드를 확인하세요 .</p>
</blockquote>
<br/>

<hr>
<h2 id="6-build-a-docker-image-with-gradle">6. Build a Docker Image with Gradle</h2>
<ul>
<li>step 6-1. Gradle로 Docker 이미지 빌드<ul>
<li>You can build a tagged <strong>docker</strong> image with <strong>Gradle</strong> in one command:
<code>./gradlew bootBuildImage --imageName=springio/gs-spring-boot-docker</code></li>
<li>Build a <strong>Docker</strong> Image with <strong>Maven</strong>
빠르게 시작하려면 다음을 변경하지 않고 Spring Boot 이미지 생성기를 실행할 수 있습니다 <strong>pom.xml</strong>( Dockerfile, 여전히 있는 경우 무시됨).
<code>./mvnw spring-boot:build-image -Dspring-boot.build-image.imageName=springio/gs-spring-boot-docker</code></li>
</ul>
</li>
</ul>
<br/>

<ul>
<li>step 6-2. <strong>To push to a Docker registry</strong>, 
ㄴ you need to have <strong>permission to push</strong>, which you do not have by default.
Docker 레지스트리에 푸시하려면 기본적으로 없는 푸시 권한이 있어야 합니다.
ㄴ. Change the <strong>image prefix</strong> to your own Dockerhub ID and <strong>docker login</strong> to make sure you are authenticated before you run Docker.
이미지 접두사를 고유한 Dockerhub ID로 변경하고 docker loginDocker를 실행하기 전에 인증되었는지 확인하십시오.</li>
</ul>
<br/>

<hr>
<h2 id="7-after-the-push">7. After the Push</h2>
<ul>
<li>*<em>step 7-1. 도커 푸쉬 *</em>
이미지 접두사를 고유한 Dockerhub ID로 변경하고 docker loginDocker를 실행하기 전에 인증되었는지 확인하십시오.<ol>
<li>docker push 예제는 실패합니다 (Dockerhub의 &quot;springio&quot; 조직에 속하지 않는 한).  </li>
<li>그러나 자신의 도커 ID와 일치하도록 구성을 변경하면 성공해야 합니다. 
그러면 새로운 태그가 지정되고 배포된 이미지가 생성됩니다.</li>
<li><strong>로컬로 빌드된 도커 이미지</strong>를 실행하기 위해 도커에 등록하거나 아무 것도 게시할 필요가 없습니다. </li>
<li>Docker로 빌드한 경우 (명령줄 또는 Spring Boot에서) 여전히 로컬로 태그가 지정된 이미지가 있으며 <strong>다음과 같이 실행</strong>할 수 있습니다.<pre><code>  $ docker run -p 8080:8080 -t springio/gs-spring-boot-docker
  Container memory limit unset. Configuring JVM for 1G container.
  Calculated JVM Memory Configuration: -XX:MaxDirectMemorySize=10M -XX:MaxMetaspaceSize=86381K -XX:ReservedCodeCacheSize=240M -Xss1M -Xmx450194K (Head Room: 0%, Loaded Class Count: 12837, Thread Count: 250, Total Memory: 1073741824)
  ....
  2015-03-31 13:25:48.035  INFO 1 --- [           main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat started on port(s): 8080 (http)
  2015-03-31 13:25:48.037  INFO 1 --- [           main] hello.Application                        : Started Application in 5.613 seconds (JVM running for 7.293)</code></pre></li>
</ol>
</li>
</ul>
<blockquote>
<p>The CF memory calculator is used at runtime to size the JVM to fit the container.
CF 메모리 계산기는 런타임에 컨테이너에 맞게 JVM의 크기를 조정하는 데 사용됩니다.</p>
</blockquote>
<ul>
<li><strong>step 7-1. 출력 확인</strong> :
The application is then available on <strong><a href="http://localhost:8080">http://localhost:8080</a></strong> (visit that and it says, “Hello Docker World”).
그런 다음 애플리케이션은 <a href="http://localhost:8080">http://localhost:8080</a> 에서 사용할 수 있습니다 (방문하면 &quot;Hello Docker World&quot;라고 표시됨).</li>
</ul>
<blockquote>
<ul>
<li>boot2docker가 있는 Mac을 사용하는 경우  &gt; 출력 예시.<br>boot2docker가 있는 Mac을 사용하는 경우, 일반적으로 시작 시 다음과 같이 표시됩니다 : </li>
</ul>
</blockquote>
<pre><code>Docker client to the Docker daemon, please set:
    export DOCKER_CERT_PATH=/Users/gturnquist/.boot2docker/certs/boot2docker-vm
    export DOCKER_TLS_VERIFY=1
    export DOCKER_HOST=tcp://192.168.59.103:2376</code></pre><blockquote>
<p>애플리케이션을 보려면 localhost 대신 DOCKER_HOST의 IP 주소를 방문해야 합니다. 이 경우 VM의 공개 IP인 <a href="https://192.168.59.103:8080%EC%9D%84">https://192.168.59.103:8080을</a> 방문해야 합니다 .</p>
</blockquote>
<ul>
<li><p>** 실행 중일 때, 출력 예시**</p>
<pre><code>$ docker ps
CONTAINER ID        IMAGE                                   COMMAND                  CREATED             STATUS              PORTS                    NAMES
81c723d22865        springio/gs-spring-boot-docker:latest   &quot;java -Djava.secur...&quot;   34 seconds ago      Up 33 seconds       0.0.0.0:8080-&gt;8080/tcp   goofy_brown  ```</code></pre></li>
<li><p><strong>컨테이너 ID로 종료 명령.</strong>  </p>
<pre><code>docker stop goofy_brown 
81c723d22865 </code></pre></li>
</ul>
<ul>
<li>*<em>컨테이너 삭제. *</em>
(/var/lib/docker작업이 끝나면 컨테이너를 삭제할 수도 있습니다. 파일 시스템 어딘가에 유지됨).
<code>docker rm goofy_brown</code></li>
</ul>
<br/>

<hr>
<h2 id="8-using-spring-profiles">8. Using Spring Profiles</h2>
<ul>
<li><strong>step 8-1. 프로파일 환경설정 및  프로파일로 실행 **
Spring 프로필로 새로 생성된 Docker 이미지를 실행하는 것은 **환경 변수를 Docker 실행 명령</strong>( prod프로필용)에 전달하는 것만큼 쉽습니다 .<ul>
<li>You can do the same for the <strong>prod profile</strong>:
<code>docker run -e &quot;SPRING_PROFILES_ACTIVE=prod&quot; -p 8080:8080 -t springio/gs-spring-boot-docker</code></li>
<li>You can do the same for the <strong>dev profile</strong>:
<code>docker run -e &quot;SPRING_PROFILES_ACTIVE=dev&quot; -p 8080:8080 -t springio/gs-spring-boot-docker</code></li>
</ul>
</li>
</ul>
<br/>

<hr>
<h2 id="9-debugging-the-application-in-a-docker-container">9. Debugging the Application in a Docker Container</h2>
<ul>
<li>디버깅
애플리케이션을 디버그하려면 <strong>JPDA Transport</strong>를 사용할 수 있습니다 . 컨테이너를 원격 서버처럼 취급(<strong>remote server treat</strong>)합니다. 
ㄴ 이 기능을 활성화하려면 <strong>JAVA_OPTS</strong>변수 에 Java 에이전트 설정을 전달 하고 컨테이너 실행 중에 에이전트의 포트를 localhost에 매핑합니다.
ㄴ Mac용 Docker를 사용하면 블랙 매직 사용 없이 IP로 컨테이너에 액세스할 수 없기 때문에 제한이 있습니다.(<strong>lack magic usage</strong>) <ul>
<li><code>docker run -e &quot;JAVA_TOOL_OPTIONS=-agentlib:jdwp=transport=dt_socket,address=5005,server=y,suspend=n&quot; -p 8080:8080 -p 5005:5005 -t springio/gs-spring-boot-docker</code></li>
</ul>
</li>
</ul>
<h2 id="10-summary">10. Summary</h2>
<p>Congratulations!</p>
<ul>
<li>You have created a Docker container for a Spring Boot application!</li>
<li>By default, Spring Boot 애플리케이션은 컨테이너 내부의 포트 8080에서 실행되며 </li>
<li>-p명령줄에서 를 사용하여 호스트의 동일한 포트에 매핑했습니다 .</li>
</ul>
<h1 id="see-also">See Also</h1>
<p>다음 가이드도 도움이 될 수 있습니다.</p>
<ul>
<li><p>Spring MVC로 웹 콘텐츠 제공</p>
</li>
<li><p>스프링 부트로 애플리케이션 빌드</p>
</li>
<li><p>Docker를 사용한 Spring Boot에 대한 주제 가이드 (이 가이드보다 더 깊이 있음)</p>
</li>
</ul>
]]></description>
        </item>
        <item>
            <title><![CDATA[도커]]></title>
            <link>https://velog.io/@coco_hye/%EB%8F%84%EC%BB%A4</link>
            <guid>https://velog.io/@coco_hye/%EB%8F%84%EC%BB%A4</guid>
            <pubDate>Thu, 07 Oct 2021 13:53:44 GMT</pubDate>
            <description><![CDATA[<p>Spring Boot with Docker
This guide walks you through the process of building a Docker image for running a Spring Boot application.
We start with a basic Dockerfile and make a few tweaks. Then we show a couple of options that use build plugins (for Maven and Gradle) instead of docker. This is a “getting started” guide, so the scope is limited to a few basic needs. If you are building container images for production use, there are many things to consider, and it is not possible to cover them all in a short guide.</p>
<p>There is also a Topical Guide on Docker, which covers a wider range of choices that we have here and in much more detail.</p>
<ol>
<li><p>What You Will Build
Docker is a Linux container management toolkit with a “social” aspect, letting users publish container images and consume those published by others. A Docker image is a recipe for running a containerized process. In this guide, we build one for a simple Spring boot application.</p>
</li>
<li><p>What You Will Need
필요 시간</p>
</li>
</ol>
<p>About 15 minutes
필요 기술</p>
<p>A favorite text editor or IDE
JDK 1.8 or later
Gradle 4+ or Maven 3.2+
You can also import the code straight into your IDE:</p>
<ul>
<li>Spring Tool Suite (STS)</li>
<li>IntelliJ IDEA
If you are NOT using a Linux machine, you need a virtualized server. If you install VirtualBox, other tools like the Mac’s boot2docker can seamlessly manage it for you. Visit VirtualBox’s download site and pick the version for your machine. Download and install. Do not worry about actually running it.</li>
</ul>
<p>You also need Docker, which only runs on 64-bit machines. See <a href="https://docs.docker.com/installation/#installation">https://docs.docker.com/installation/#installation</a> for details on setting Docker up for your machine. Before proceeding further, verify you can run docker commands from the shell. If you use boot2docker, you need to run that first.</p>
<ol start="3">
<li>Starting with Spring Initializr
To initialize the project:</li>
</ol>
<p>Navigate to <a href="https://start.spring.io">https://start.spring.io</a>. This service pulls in all the dependencies you need for an application and does most of the setup for you.</p>
<p>Choose either Gradle or Maven and the language you want to use. This guide assumes that you chose Java.</p>
<p>Click Dependencies and select Spring Web.</p>
<p>Click Generate.</p>
<p>Download the resulting ZIP file, which is an archive of a web application that is configured with your choices.</p>
<p>If your IDE has the Spring Initializr integration, you can complete this process from your IDE.</p>
<p>You can also fork the project from Github and open it in your IDE or other editor.</p>
<ol start="4">
<li>Set up a Spring Boot Application
Now you can create a simple application:</li>
</ol>
<p>src/main/java/hello/Application.java</p>
<p>package hello;</p>
<p>import org.springframework.boot.SpringApplication;
import org.springframework.boot.autoconfigure.SpringBootApplication;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;</p>
<p>@SpringBootApplication
@RestController
public class Application {</p>
<p>  @RequestMapping(&quot;/&quot;)
  public String home() {
    return &quot;Hello Docker World&quot;;
  }</p>
<p>  public static void main(String[] args) {
    SpringApplication.run(Application.class, args);
  }</p>
<p>}
The class is flagged as a @SpringBootApplication and as a @RestController, meaning that it is ready for use by Spring MVC to handle web requests. @RequestMapping maps / to the home() method, which sends a Hello World response. The main() method uses Spring Boot’s SpringApplication.run() method to launch an application.</p>
<p>Now we can run the application without the Docker container (that is, in the host OS):</p>
<p>If you use Gradle, run the following command:</p>
<p>./gradlew build &amp;&amp; java -jar build/libs/gs-spring-boot-docker-0.1.0.jar
If you use Maven, run the following command:</p>
<p>./mvnw package &amp;&amp; java -jar target/gs-spring-boot-docker-0.1.0.jar
Then go to localhost:8080 to see your “Hello Docker World” message.</p>
<ol start="5">
<li>Containerize It
Docker has a simple &quot;Dockerfile&quot; file format that it uses to specify the “layers” of an image. Create the following Dockerfile in your Spring Boot project:</li>
</ol>
<p>Example 1. Dockerfile
FROM openjdk:8-jdk-alpine
ARG JAR_FILE=target/*.jar
COPY ${JAR_FILE} app.jar
ENTRYPOINT [&quot;java&quot;,&quot;-jar&quot;,&quot;/app.jar&quot;]
If you use Gradle, you can run it with the following command:</p>
<p>docker build --build-arg JAR_FILE=build/libs/*.jar -t springio/gs-spring-boot-docker
If you use Maven, you can run it with the following command:</p>
<p>docker build -t springio/gs-spring-boot-docker .
This command builds an image and tags it as</p>
<p>springio/gs-spring-boot-docker.
This Dockerfile is very simple, but it is all you need to run a Spring Boot app with no frills: just Java and a JAR file. The build creates a spring user and a spring group to run the application. It is then copied (by the COPY command) the project JAR file into the container as app.jar, which is run in the ENTRYPOINT. The array form of the Dockerfile ENTRYPOINT is used so that there is no shell wrapping the Java process. The Topical Guide on Docker goes into this topic in more detail.</p>
<p>To reduce Tomcat startup time, we used to add a system property pointing to /dev/urandom as a source of entropy. This is not necessary anymore with JDK 8 or later.</p>
<p>Running applications with user privileges helps to mitigate some risks (see, for example, a thread on StackExchange). So, an important improvement to the Dockerfile is to run the application as a non-root user:</p>
<p>Example 2. Dockerfile
FROM openjdk:8-jdk-alpine
RUN addgroup -S spring &amp;&amp; adduser -S spring -G spring
USER spring:spring
ARG JAR_FILE=target/*.jar
${JAR_FILE} app.jar
ENTRYPOINT [&quot;java&quot;,&quot;-jar&quot;,&quot;/app.jar&quot;]
You can see the username in the application startup logs when you build and run the application:</p>
<p>docker build -t springio/gs-spring-boot-docker .
docker run -p 8080:8080 springio/gs-spring-boot-docker
Note the started by in the first INFO log entry:</p>
<p> :: Spring Boot ::        (v2.2.1.RELEASE)</p>
<p>2020-04-23 07:29:41.729  INFO 1 --- [           main] hello.Application                        : Starting Application on b94c86e91cf9 with PID 1 (/app started by spring in /)
...
Also, there is a clean separation between dependencies and application resources in a Spring Boot fat JAR file, and we can use that fact to improve performance. The key is to create layers in the container filesystem. The layers are cached both at build time and at runtime (in most runtimes), so we want the most frequently changing resources (usually the class and static resources in the application itself) to be layered after the more slowly changing resources. Thus, we use a slightly different implementation of the Dockerfile:</p>
<p>Example 3. Dockerfile
FROM openjdk:8-jdk-alpine
RUN addgroup -S spring &amp;&amp; adduser -S spring -G spring
USER spring:spring
ARG DEPENDENCY=target/dependency
COPY ${DEPENDENCY}/BOOT-INF/lib /app/lib
COPY ${DEPENDENCY}/META-INF /app/META-INF
COPY ${DEPENDENCY}/BOOT-INF/classes /app
ENTRYPOINT [&quot;java&quot;,&quot;-cp&quot;,&quot;app:app/lib/*&quot;,&quot;hello.Application&quot;]
This Dockerfile has a DEPENDENCY parameter pointing to a directory where we have unpacked the fat JAR. To use the DEPENDENCY parameter with Gradle, run the following command:</p>
<p>mkdir -p build/dependency &amp;&amp; (cd build/dependency; jar -xf ../libs/*.jar)
To use the DEPENDENCY parameter with Maven, run the following command:</p>
<p>mkdir -p target/dependency &amp;&amp; (cd target/dependency; jar -xf ../*.jar)
If we get that right, it already contains a BOOT-INF/lib directory with the dependency JARs in it, and a BOOT-INF/classes directory with the application classes in it. Notice that we use the application’s own main class: hello.Application. (This is faster than using the indirection provided by the fat JAR launcher.)</p>
<p>Exploding the JAR file can result in the classpath order being different at runtime. A well-behaved and well-written application should not care about this, but you may see behavior changes if the dependencies are not carefully managed.</p>
<p>If you use boot2docker, you need to run it first before you do anything with the Docker command line or with the build tools (it runs a daemon process that handles the work for you in a virtual machine).</p>
<p>From a Gradle build, you need to add the explicit build arguments in the Docker command line:</p>
<p>docker build --build-arg DEPENDENCY=build/dependency -t springio/gs-spring-boot-docker .
To build the image in Maven, you can use a simpler Docker command line:</p>
<p>docker build -t springio/gs-spring-boot-docker .
Of course, if you use only Gradle, you could change the Dockerfile to make the default value of DEPENDENCY match the location of the unpacked archive.</p>
<p>Instead of building with the Docker command line, you might want to use a build plugin. Spring Boot supports building a container from Maven or Gradle by using its own build plugin. Google also has an open source tool called Jib that has Maven and Gradle plugins. Probably the most interesting thing about this approach is that you do not need a Dockerfile. You can build the image by using the same standard container format as you get from docker build. Also, it can work in environments where docker is not installed (not uncommon in build servers).</p>
<p>By default, the images generated by the default buildpacks do not run your application as root. Check the configuration guide for Gradle or Maven for how to change the default settings.</p>
<ol start="6">
<li>Build a Docker Image with Gradle
You can build a tagged docker image with Gradle in one command:</li>
</ol>
<p>./gradlew bootBuildImage --imageName=springio/gs-spring-boot-docker
6.1. Build a Docker Image with Maven
To get started quickly, you can run the Spring Boot image generator without even changing your pom.xml (remember that the Dockerfile, if it is still, there is ignored):</p>
<p>./mvnw spring-boot:build-image -Dspring-boot.build-image.imageName=springio/gs-spring-boot-docker
To push to a Docker registry, you need to have permission to push, which you do not have by default. Change the image prefix to your own Dockerhub ID and docker login to make sure you are authenticated before you run Docker.</p>
<ol start="7">
<li>After the Push
A docker push in the example fails (unless you are part of the &quot;springio&quot; organization at Dockerhub). However, if you change the configuration to match your own docker ID, it should succeed. You then have a new tagged, deployed image.</li>
</ol>
<p>You do NOT have to register with docker or publish anything to run a docker image that was built locally. If you built with Docker (from the command line or from Spring Boot), you still have a locally tagged image, and you can run it like this:</p>
<p>$ docker run -p 8080:8080 -t springio/gs-spring-boot-docker
Container memory limit unset. Configuring JVM for 1G container.
Calculated JVM Memory Configuration: -XX:MaxDirectMemorySize=10M -XX:MaxMetaspaceSize=86381K -XX:ReservedCodeCacheSize=240M -Xss1M -Xmx450194K (Head Room: 0%, Loaded Class Count: 12837, Thread Count: 250, Total Memory: 1073741824)
....
2015-03-31 13:25:48.035  INFO 1 --- [           main] s.b.c.e.t.TomcatEmbeddedServletContainer : Tomcat started on port(s): 8080 (http)
2015-03-31 13:25:48.037  INFO 1 --- [           main] hello.Application                        : Started Application in 5.613 seconds (JVM running for 7.293)
The CF memory calculator is used at runtime to size the JVM to fit the container.</p>
<p>The application is then available on <a href="http://localhost:8080">http://localhost:8080</a> (visit that and it says, “Hello Docker World”).</p>
<p>When using a Mac with boot2docker, you typically see things like this at startup:</p>
<p>Docker client to the Docker daemon, please set:
    export DOCKER_CERT_PATH=/Users/gturnquist/.boot2docker/certs/boot2docker-vm
    export DOCKER_TLS_VERIFY=1
    export DOCKER_HOST=tcp://192.168.59.103:2376
To see the application, you must visit the IP address in DOCKER_HOST instead of localhost — in this case, <a href="https://192.168.59.103:8080">https://192.168.59.103:8080</a>, the public facing IP of the VM.</p>
<p>When it is running, you can see in the list of containers, similar to the following example:</p>
<p>$ docker ps
CONTAINER ID IMAGE COMMAND CREATED STATUS PORTS NAMES
81c723d22865 springio/gs-spring-boot-docker:latest &quot;java -Djava.secur...&quot; 34 seconds ago Up 33 seconds 0.0.0.0:8080-&gt;8080/tcp goofy_brownCOPY
To shut it down again, you can run docker stop with the container ID from the previous listing (yours will be different):</p>
<p>docker stop goofy_brown
81c723d22865COPY
If you like, you can also delete the container (it is persisted in your filesystem somewhere under /var/lib/docker) when you are finished with it:</p>
<p>docker rm goofy_brownCOPY</p>
<ol start="8">
<li>Using Spring Profiles
Running your freshly minted Docker image with Spring profiles is as easy as passing an environment variable to the Docker run command (for the prod profile):</li>
</ol>
<p>docker run -e &quot;SPRING_PROFILES_ACTIVE=prod&quot; -p 8080:8080 -t springio/gs-spring-boot-docker
You can do the same for the dev profile:</p>
<p>docker run -e &quot;SPRING_PROFILES_ACTIVE=dev&quot; -p 8080:8080 -t springio/gs-spring-boot-docker
9. Debugging the Application in a Docker Container
To debug the application, you can use JPDA Transport. We treat the container like a remote server. To enable this feature, pass Java agent settings in the JAVA_OPTS variable and map the agent’s port to localhost during a container run. With Docker for Mac, there is a limitation because we can’t access the container by IP without black magic usage.</p>
<p>docker run -e &quot;JAVA_TOOL_OPTIONS=-agentlib:jdwp=transport=dt_socket,address=5005,server=y,suspend=n&quot; -p 8080:8080 -p 5005:5005 -t springio/gs-spring-boot-docker
10. Summary
Congratulations! You have created a Docker container for a Spring Boot application! By default, Spring Boot applications run on port 8080 inside the container, and we mapped that to the same port on the host by using -p on the command line.</p>
<p>See Also
The following guides may also be helpful:</p>
<p>Serving Web Content with Spring MVC</p>
<p>Building an Application with Spring Boot</p>
<p>Topical Guide on Spring Boot with Docker (more depth than this guide)</p>
<p>Want to write a new guide or contribute to an existing one? Check out our contribution guidelines.</p>
]]></description>
        </item>
        <item>
            <title><![CDATA[10월]]></title>
            <link>https://velog.io/@coco_hye/10%EC%9B%94</link>
            <guid>https://velog.io/@coco_hye/10%EC%9B%94</guid>
            <pubDate>Thu, 07 Oct 2021 02:24:44 GMT</pubDate>
            <description><![CDATA[<p>10.07</p>
<p>(Done) 교보생명 어드민 봇 관련 문의 대응 ( w 루카스 ) - 1h
ㄴ 어플리케이션 접근 &gt; vpn 락 확인
ㄴ 깃 구동 &gt; 그레들 오류 확인
ㄴ 담당자확인 및 내용 전달</p>
]]></description>
        </item>
        <item>
            <title><![CDATA[환경 설정 ]]></title>
            <link>https://velog.io/@coco_hye/%ED%99%98%EA%B2%BD-%EC%84%A4%EC%A0%95</link>
            <guid>https://velog.io/@coco_hye/%ED%99%98%EA%B2%BD-%EC%84%A4%EC%A0%95</guid>
            <pubDate>Thu, 23 Sep 2021 05:17:13 GMT</pubDate>
            <description><![CDATA[<h2 id="1-라이브러리">1. 라이브러리</h2>
<h3 id="11-라이브러리와-maven-gradle">1.1. 라이브러리와 maven/ gradle</h3>
<p>gradle : 다운로드와 라이브러리 종속성 관리를 위한 도입
<a href="https://linkeverything.github.io/study/springboot/add-library/">https://linkeverything.github.io/study/springboot/add-library/</a></p>
<p>gradle : 멀티프로젝트를 위한 도입
<a href="https://engineering.linecorp.com/ko/blog/mono-repo-multi-project-gradle-plugin/">https://engineering.linecorp.com/ko/blog/mono-repo-multi-project-gradle-plugin/</a></p>
<h3 id="12-gradle-사용자-라이브러리-추가">1.2. gradle 사용자 라이브러리 추가</h3>
<p>Spring + gradle 사용시 Tibero 같이 repo에 없는 라이브러리들이 필요한 경우나 폐쇄망에선 다음과같이 라이브러리를 추가한다</p>
<ol>
<li><p>프로젝트 폴더 최상단에 libs 폴더 생성(이름은 마음대로)</p>
</li>
<li><p>폴더에 라이브러리 복사</p>
</li>
<li><p>build.gradle - dependencies 블럭에 다음과 같은 코드를 추가한다.</p>
</li>
</ol>
<blockquote>
<p> dependencies {<br>      compile files(&quot;libs/tibero6-jdbc-14.jar&quot;)
   } </p>
</blockquote>
<ol start="4">
<li>Refresh Gradle Project
출처 : <a href="https://sy-dev.tistory.com/28">https://sy-dev.tistory.com/28</a></li>
</ol>
<br/>

<h3 id="13-라이브러리-clean">1.3. 라이브러리 clean</h3>
<ul>
<li>현상 : jsp 라이브러리 gradle에 추가 &gt; refresh하여 등록 &gt; jsp샘플 페이지 생성  &gt; 웹브라우저에 webapp하위 jsp 경로인 rootDoc URL 호출. &gt;  jsp페이지 호출이 아닌 다운로드가 됨.</li>
<li>문제(원인) : 라이브러리의 정상 등록이 안됨. 
out.write(&quot;abc&quot;) 메소드의 빨간줄로 확인</li>
<li>해결 : 라이브러리 캐시 clean 
<a href="https://countryxide.tistory.com/155">https://countryxide.tistory.com/155</a></li>
</ul>
]]></description>
        </item>
        <item>
            <title><![CDATA[기술 문서 구독 ]]></title>
            <link>https://velog.io/@coco_hye/%EA%B8%B0%EC%88%A0-%EB%AC%B8%EC%84%9C-%EA%B5%AC%EB%8F%85</link>
            <guid>https://velog.io/@coco_hye/%EA%B8%B0%EC%88%A0-%EB%AC%B8%EC%84%9C-%EA%B5%AC%EB%8F%85</guid>
            <pubDate>Thu, 16 Sep 2021 02:04:20 GMT</pubDate>
            <description><![CDATA[<p>2021.09.16</p>
<p>기술문서 구독</p>
<ol>
<li>HTTP 어플리케이션 <a href="https://kscodebase.tistory.com/category/programming/HTTP">https://kscodebase.tistory.com/category/programming/HTTP</a></li>
</ol>
<ul>
<li>http 통신 != socket 통신 
<a href="https://pearlluck.tistory.com/335">https://pearlluck.tistory.com/335</a></li>
</ul>
<ol start="2">
<li>socket 어플리케이션 
<a href="https://medium.com/@chullino/http%EC%97%90%EC%84%9C%EB%B6%80%ED%84%B0-websocket%EA%B9%8C%EC%A7%80-94df91988788">https://medium.com/@chullino/http%EC%97%90%EC%84%9C%EB%B6%80%ED%84%B0-websocket%EA%B9%8C%EC%A7%80-94df91988788</a></li>
</ol>
]]></description>
        </item>
        <item>
            <title><![CDATA[일간 일지]]></title>
            <link>https://velog.io/@coco_hye/%EC%9D%BC%EA%B0%84-%EC%9D%BC%EC%A7%80</link>
            <guid>https://velog.io/@coco_hye/%EC%9D%BC%EA%B0%84-%EC%9D%BC%EC%A7%80</guid>
            <pubDate>Tue, 14 Sep 2021 04:26:13 GMT</pubDate>
            <description><![CDATA[<blockquote>
<p>2020.09.14</p>
</blockquote>
<ul>
<li>git 클라이언트 &#39; fork &#39; 도입 </li>
<li>포트폴리오용 jira 도입 보류 ( 원리를 몰겟슘 ) </li>
</ul>
]]></description>
        </item>
        <item>
            <title><![CDATA[dd]]></title>
            <link>https://velog.io/@coco_hye/dd</link>
            <guid>https://velog.io/@coco_hye/dd</guid>
            <pubDate>Fri, 10 Sep 2021 06:30:48 GMT</pubDate>
            <description><![CDATA[<p>PROJECT</p>
<ul>
<li>메이븐</li>
<li>그레들</li>
</ul>
<p>LANGUAGE</p>
<ul>
<li>자바</li>
<li>코틀린</li>
<li>그루비</li>
</ul>
<p>PRJ MetaData
Group
Artifact
Package Name</p>
<p>Packaging ( 둘다 내장서버 포함 가능 )</p>
<ul>
<li>jar</li>
<li>war : JSP 구동 제공하기때문에 was, 톰캣서버 별도 설치가능 제공.</li>
</ul>
]]></description>
        </item>
        <item>
            <title><![CDATA[GIT 메모]]></title>
            <link>https://velog.io/@coco_hye/GIT-%EB%A9%94%EB%AA%A8</link>
            <guid>https://velog.io/@coco_hye/GIT-%EB%A9%94%EB%AA%A8</guid>
            <pubDate>Thu, 09 Sep 2021 07:49:27 GMT</pubDate>
            <description><![CDATA[<p>프로젝트 생성</p>
<ul>
<li>프로젝트 정상 실행 테스트 
  spring boot 다운 / 톰캣 구동 / localhost:8080 white errror 페이지 정상확인</li>
</ul>
<blockquote>
<p>white errror
    페이지가 없어 에러페이지를 정상적으로 포워딩 시켜준거임 ( 정상)  </p>
</blockquote>
]]></description>
        </item>
        <item>
            <title><![CDATA[서블릿]]></title>
            <link>https://velog.io/@coco_hye/%EC%84%9C%EB%B8%94%EB%A6%BF</link>
            <guid>https://velog.io/@coco_hye/%EC%84%9C%EB%B8%94%EB%A6%BF</guid>
            <pubDate>Wed, 08 Sep 2021 14:57:20 GMT</pubDate>
            <description><![CDATA[<p>개요1 - 제공 기능
서블릿 이 제공하는 Request,Response 객체에 대해 알아본다.</p>
<p>개요2 - 서버에서 어떻게 구현할꺼야 ?
결국 서블릿은 , HTTP 요청을 어떻게 받고, HTTP 응답을 어떻게 내려줄거야?를
개발자가 서버에서 어떻게 편하게 구현할까에 대한것.</p>
<blockquote>
<p>어떻게 사용하는지, 어떻게 해결하면 되는지.</p>
</blockquote>
]]></description>
        </item>
        <item>
            <title><![CDATA[아키텍처란?]]></title>
            <link>https://velog.io/@coco_hye/%EC%95%84%ED%82%A4%ED%85%8D%EC%B2%98%EB%9E%80</link>
            <guid>https://velog.io/@coco_hye/%EC%95%84%ED%82%A4%ED%85%8D%EC%B2%98%EB%9E%80</guid>
            <pubDate>Wed, 08 Sep 2021 06:31:31 GMT</pubDate>
            <description><![CDATA[<p>아키텍처 개념 </p>
<ul>
<li>시스템 목적을 달성하기위해 시스템의 상호작용등의 시스템디자인에 대한 제약 및 설계이다</li>
<li>산출물 &gt; 시스템 구성도
<a href="https://tuhbm.github.io/2019/04/24/architecture/">https://tuhbm.github.io/2019/04/24/architecture/</a></li>
</ul>
<p>아키텍처를 다루는 사람들</p>
<ul>
<li>R&amp;R &gt; 나중에 시스템 구성도별 R&amp;R 분리해보기. <a href="https://thinkground.studio/%EC%95%84%ED%82%A4%ED%85%8D%ED%8A%B8-architecture%EB%A5%BC-%EB%8B%A4%EB%A3%A8%EB%8A%94-%EC%82%AC%EB%9E%8C/">https://thinkground.studio/%EC%95%84%ED%82%A4%ED%85%8D%ED%8A%B8-architecture%EB%A5%BC-%EB%8B%A4%EB%A3%A8%EB%8A%94-%EC%82%AC%EB%9E%8C/</a></li>
</ul>
]]></description>
        </item>
        <item>
            <title><![CDATA[링크와 프레임 (내부,외부,버튼,div,link)]]></title>
            <link>https://velog.io/@coco_hye/%EB%A7%81%ED%81%AC%EC%99%80-%ED%94%84%EB%A0%88%EC%9E%84-%EB%82%B4%EB%B6%80%EC%99%B8%EB%B6%80%EB%B2%84%ED%8A%BCdivlink</link>
            <guid>https://velog.io/@coco_hye/%EB%A7%81%ED%81%AC%EC%99%80-%ED%94%84%EB%A0%88%EC%9E%84-%EB%82%B4%EB%B6%80%EC%99%B8%EB%B6%80%EB%B2%84%ED%8A%BCdivlink</guid>
            <pubDate>Wed, 08 Sep 2021 04:48:53 GMT</pubDate>
            <description><![CDATA[<p>링크 종류</p>
<h2 id="1-구현">1. 구현</h2>
<h3 id="1-1-문서-외부-이동-앵커-활용">1-1 문서 외부 이동 (앵커 활용)</h3>
<h3 id="1-2-문서-내부-이동-앵커-활용">1-2 문서 내부 이동 (앵커 활용)</h3>
<h3 id="1-3-버튼-ui-이동">1-3 버튼 UI 이동</h3>
<h3 id="1-4-div-이동">1-4 DIV 이동</h3>
<h3 id="1-5-link-이동">1-5 Link 이동</h3>
<h2 id="2-추가-살-붙이기-">2. 추가 (살 붙이기 )</h2>
<h3 id="2-1-해당-위치로-이동--css로-구현-">2-1 해당 위치로 이동 ( CSS로 구현 )</h3>
<blockquote>
<p>이 문제를 해결하기 위해서 <strong>스크립트를 사용하지 않고 CSS 스타일만</strong>으로 <strong>해결</strong>되는 간단한 방법이 없을지 여러 방법들을 테스트하다가 아래와 같이 코드를 작성하였다.
출처 : <a href="https://dev.meye.net/entry/%ED%8E%98%EC%9D%B4%EC%A7%80-%EB%A7%81%ED%81%AC-%EC%9D%B4%EB%8F%99-%EA%B3%A0%EC%A0%95-%ED%97%A4%EB%8D%94-%EA%B0%80%EB%A6%AC%EB%8A%94-%EB%AC%B8%EC%A0%9C">동일 페이지에서 링크로 섹션 이동시 고정 헤더에 가리는 문제</a></p>
</blockquote>
<h2 id="3-앵커-a">3. 앵커 <code>&lt;a&gt;</code></h2>
<h3 id="3-1-속성">3-1 속성</h3>
<h3 id="3-2-주소-체계">3-2. 주소 체계</h3>
<h4 id="3-2-1-상대-주소">3-2-1 상대 주소</h4>
<h4 id="3-2-2-절대-주소">3-2-2 절대 주소</h4>
<h2 id="4-참고">4. 참고</h2>
<h3 id="참고1-웹-프로그래밍---링크와-프레임iframe">참고1. <a href="https://velog.io/@heigarnik/%EC%9B%B9-%ED%94%84%EB%A1%9C%EA%B7%B8%EB%9E%98%EB%B0%8D-%EB%A7%81%ED%81%AC%EC%99%80-%ED%94%84%EB%A0%88%EC%9E%84iframe">웹 프로그래밍 - 링크와 프레임(<code>&lt;iframe&gt;</code>)</a></h3>
<h3 id="참고2-html-a-태그">참고2. <a href="https://leeyenote.tistory.com/5?category=931521">HTML A 태그 </a></h3>
<h3 id="참고3-페이지문서-또는-다른-페이지의-특정-위치로-이동하기">참고3. <a href="https://ojji.wayful.com/2015/04/HTML-A-Link-tag-Anchor-to-Jump-To-Specific-Line-Paragraph-Point-Location-On-A-Page-or-Other-Page.html">페이지(문서) 또는 다른 페이지의 특정 위치로 이동하기 </a></h3>
]]></description>
        </item>
        <item>
            <title><![CDATA[애플리케이션 관점 가이드]]></title>
            <link>https://velog.io/@coco_hye/%EC%95%A0%ED%94%8C%EB%A6%AC%EC%BC%80%EC%9D%B4%EC%85%98-%EA%B4%80%EC%A0%90-%EA%B0%80%EC%9D%B4%EB%93%9C</link>
            <guid>https://velog.io/@coco_hye/%EC%95%A0%ED%94%8C%EB%A6%AC%EC%BC%80%EC%9D%B4%EC%85%98-%EA%B4%80%EC%A0%90-%EA%B0%80%EC%9D%B4%EB%93%9C</guid>
            <pubDate>Wed, 08 Sep 2021 03:36:13 GMT</pubDate>
            <description><![CDATA[<h1 id="twelve-factor-방법론">Twelve Factor 방법론</h1>
<p><strong>SaaS 앱을 개발하기 위한 방법론</strong></p>
<h2 id="1-특징">1. 특징</h2>
<ul>
<li>설정 자동화를 위한 절차 체계화로 새로운 개발자가 프로젝트에 참여하는데 드는 시간과 비용을 최소화</li>
<li>OS에 따라 달라지는 부분을 명확히하고, 실행 환경 사이의 이식성을 극대화</li>
<li>최근 등장한 클라우드 플랫폼 배포에 적합하고, 서버와 시스템의 관리가 불필요</li>
<li>개발 환경과 운영 환경의 차이를 최소화하고 민첩성을 극대화하기 위해 지속적인 배포 가능</li>
<li>툴, 아키텍처, 개발 방식을 크게 바꾸지 않고 확장(scale up) 가능</li>
</ul>
<hr>
<h2 id="2-12개의-요소">2. 12개의 요소</h2>
<table>
<thead>
<tr>
<th><center>번호</center></th>
<th align="left"><center>요소</center></th>
<th align="center"><center>설명</center></th>
</tr>
</thead>
<tbody><tr>
<td>1</td>
<td align="left">코드베이스</td>
<td align="center">버전 관리되는 하나의 코드베이스와 다양한 배포</td>
</tr>
<tr>
<td>2</td>
<td align="left">종속성</td>
<td align="center">명시적으로 선언되고 분리된 종속성</td>
</tr>
<tr>
<td>3</td>
<td align="left">설정</td>
<td align="center">환경(environment)에 저장된 설정</td>
</tr>
<tr>
<td>4</td>
<td align="left">백엔드 서비스</td>
<td align="center">백엔드 서비스를 연결된 리소스로 취급</td>
</tr>
<tr>
<td>5</td>
<td align="left"><a id="b1" href="https://velog.io/@coco_hye/%EC%95%A0%ED%94%8C%EB%A6%AC%EC%BC%80%EC%9D%B4%EC%85%98-%EA%B4%80%EC%A0%90-%EA%B0%80%EC%9D%B4%EB%93%9C#dscp_b1" >빌드</a>, 릴리즈, 실행</td>
<td align="center">철저하게 분리된 빌드와 실행 단계</td>
</tr>
<tr>
<td>6</td>
<td align="left">프로세스</td>
<td align="center">애플리케이션을 하나 혹은 여러개의 무상태(stateless) 프로세스로 실행</td>
</tr>
<tr>
<td>7</td>
<td align="left">포트 바인딩</td>
<td align="center">포트 바인딩을 사용해서 서비스를 공개함</td>
</tr>
<tr>
<td>8</td>
<td align="left">동시성(Concurrency)</td>
<td align="center">프로세스 모델을 사용한 확장</td>
</tr>
<tr>
<td>9</td>
<td align="left">폐기 가능(Disposability)</td>
<td align="center">빠른 시작과 그레이스풀 셧다운(graceful shutdown)을 통한 안정성 극대화</td>
</tr>
<tr>
<td>10</td>
<td align="left">개발/프로덕션환경 일치</td>
<td align="center">개발, 스테이징, 프로덕션 환경을 최대한 비슷하게 유지</td>
</tr>
<tr>
<td>11</td>
<td align="left">로그</td>
<td align="center">로그를 이벤트 스트림으로 취급</td>
</tr>
<tr>
<td>12</td>
<td align="left">Admin 프로세스</td>
<td align="center">admin/maintenance 작업을 일회성 프로세스로 실행</td>
</tr>
</tbody></table>
<p><br/><br/></p>
<hr>
<h3 id="5-4-철저하게-분리된-빌드와-실행단계">5-4 철저하게 분리된 빌드와 실행단계</h3>
<h3 id="5-4-2-컴파일compile">&gt; 5-4-2 컴파일(Compile)</h3>
<p>컴파일이란 개발자가 작성한 소스코드를 바이너리 코드로 변환하는 과정을 말한다. (목적파일이 생성됨) </p>
<p>즉, 컴퓨터가 이해할 수 있는 기계어로 변환하는 작업이다. 이러한 작업을 해주는 프로그램을 가르켜 컴파일러(Compiler)라 한다.</p>
<p>자바의 경우, 자바가상머신(JVM)에서 실행가능한 바이트코드 형태의 클래스파일이 생성이 된다.</p>
<br/>
### > 5-4-2 링크(link)

<p>프로젝트를 진행하다 보면 소스파일이 여러개가 생성이되고 A라는 소스파일에서 B라는 소스파일에 존재하는 함수(메서드)를 호출하는 경우가 있다.</p>
<p>이때 A와 B 소스파일 각각을 컴파일만 하면 A가 B에 존재하는 함수를 찾질 못하기 때문에 호출할 수가 없다.</p>
<p>따라서 A와 B를 연결해주는 작업이 필요한데 이 작업을 링크라고 한다.</p>
<p>여러개로 분리된 소스파일들을 컴파일한 결과물들에서 최종 실행가능한 파일을 만들기 위해 필요한 부분을 찾아서 연결해주는 작업이다.</p>
<p>링크는 정적링크(static link)와 동적링크(dynamic link)가 있는데</p>
<p>정적링크란 컴파일된 소스파일을 연결해서 실행가능한 파일을 만드는 것이고, 동적링크란 프로그램 실행 도중 프로그램 외부에 존재하는 코드를 찾아서 연결하는 작업을 말한다.</p>
<p>자바의 경우, JVM이 프로그램 실행 도중 필요한 클래스를 찾아서 클래스패스에 로드해주는데 이는 동적링크의 예이다.</p>
<br/>
### > 5-4-3 <a id="dscp_b1" href="#b1"> 빌드(Build) </a>

<p>소스코드 파일을 실행가능한 소프트웨어 산출물로 만드는 일련의 과정을 말한다. </p>
<p>빌드의 단계 중 컴파일이 포함이 되어 있는데 컴파일은 빌드의 부분집합이라 할 수 있다.</p>
<p>빌드 과정을 도와주는 도구를 빌드 툴이라 한다.</p>
<br/>
### > 5-4-4 빌드 툴(Build Tool)

<p>일반적으로 빌드 툴이 제공해주는 기능으로는 다음과 같은 기능들이 있다.</p>
<p>전처리(preprocessing), 컴파일(Compile), 패키징(packaging), 테스팅(testing), 배포(distribution)</p>
<p>빌드 툴로는 Ant, Maven, Gradle 등이 있다.
<br/></p>
<p>출처: <a href="https://itwiki.kr/w/Twelve_Factor_%EB%B0%A9%EB%B2%95%EB%A1%A0">https://itwiki.kr/w/Twelve_Factor_%EB%B0%A9%EB%B2%95%EB%A1%A0</a>
출처: <a href="https://freezboi.tistory.com/39">https://freezboi.tistory.com/39</a> [코딩 공작소]</p>
]]></description>
        </item>
    </channel>
</rss>