TIL.Docker. <22.07.04>

강형원·2022년 7월 4일
0

Docker

목록 보기
2/3
post-thumbnail

오늘 해야 할 일

  • Docker 강의 듣기
  • 프롬 스크래치 한 번 더 확인
  • TS 강의 듣기

오늘 배운 것

Resistry

What it is

The Registry is a stateless, highly scalable server side application that stores and lets you distribute Docker images. The Registry is open-source, under the permissive Apache license.

Why use it

You should use the Registry if you want to:

  • tightly control where your images are being stored
  • fully own your images distribution pipeline
  • integrate image storage and distribution tightly into your in-house development workflow

docker container 멈추기

  • SIGTERM: docker stop {container_id|conatinaer_name}
  • SIGKILL: docker kill {container_id|conatinaer_name}

오늘 공부 한 것

TS

타입의 프로퍼티가 같으면 디스크리미네이티드 유니언 타입으로 쓸 수 있다.

  type SuccessState = {
    result: "success"; // 동일한 result라는 key의 type은  문자열인 'success'와 'fail'을 준다.
    response: {
      body: string;
    };
  };
  
  type FailState = {
    result: "fail";
    reason: string;
  };
  
  type LoginState = SuccessState | FailState;
  
  function printLoginState(state: LoginState): void {
    // state 즉 LoginState 타입에는 result는 success든 fail이든 다 들어있어서 result를 바로 보여준다.
    if (state.result === "success") {
      console.log(`🎉 ${state.response.body}`);
    } else {
      console.log(`😭 ${state.reason}`);
  }
profile
사람. 편하게.

0개의 댓글