Git Product home page Git Product logo

docker-test's Introduction

Dockerfile

# base 이미지를 지정한다
# FROM ubuntu:20.04
FROM alpine

# 환경변수를 지정
ENV MYHOME /my/home

# 디렉토리를 생성하고 현재 경로를 해당 디렉토리로 변경한다
WORKDIR $MYHOME
RUN touch $MYHOME/myfile.txt

WORKDIR /aa
# host 안의 파일을 container 안으로 복사한다
COPY file1.txt /aa/fileA.txt

# /app 디렉토리가 없으면 생성하고 파일을 카피한다
COPY target/myapp.jar /app/app.jar

# container 가 실행될 때 동작할 명령을 지정
ENTRYPOINT ["tail", "-f", "/dev/null"]

docker pull

docker pull ubuntu:20.04

docker build

docker build -t myubuntu:20.04 -f ubuntu/Dockerfile .

docker run

# -p 8080:80 | 호스트 8080 포트를 컨테이너 80 포트로 포워딩
docker run -itd -p 8080:80 --name ubuntu ubuntu:20.04

docker exec

docker exec -it ubuntu bash

도커 컨테이너 모두 삭제

docker rm -f `docker ps -aq`

도커 이미지 모두 삭제

docker rmi `docker images -q`

docker ps

docker ps
docker ps -a

docker best practices

docker best practices

docker-test's People

Contributors

hothoony avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.