IT Curation 자세히보기

Container/Docker

로그 테스트 컨테이너

icf_ 2023. 10. 24. 12:42
vi app.py
import json
import time

if __name__ == '__main__':
    while True:
        d = {'name': 'fakenerd', 'time_ms': int(time.time() * 1000)}
        print(json.dumps(d))
        time.sleep(3)
vi Dockerfile
FROM python:3.7.5-slim

WORKDIR /app
COPY . /app

ENTRYPOINT ["python", "-u", "app.py"]
docker build -t py_log:latest .

docker image tag py_log:latest seongdong/py_log:latest

docker push seongdong/py_log:latest
728x90