inflearn logo
강의

강의

N
챌린지

챌린지

멘토링

멘토링

N
클립

클립

로드맵

로드맵

지식공유

따라하며 배우는 도커와 CI환경 [2023.11 업데이트]

travis.yml 파일 작성하기 (배포 부분)

travis.yml before_install 문의

225

쏭쏭2

작성한 질문수 4

0

9강 travis.yml 파일작성하기에서의 문의 입니다.

before_install: 에서 image 빌드를 하는데,  ./frontend/Dockerfile.dev를 참고하도록 되어 있습니다. 

script: 에서 docker를 run을 해주는데요,
이 이미지로 도커를 실행하여 npm run test를 합니다.

after_success: 에서 다시
./frontend Dockerfile 로 docker-frontend 이름으로 이미지를 다시 만드는데요, 

./frontend 디렉토리 안에서 Dockerfile과 Dockerfile.dev를 구분해서 만들고,

before_install:에서 만드는 이미지와  after_success:에서 만드는 도커 이미지를 다르게 이름을 가져가야할 필요가 있는 지, 

있다면 그 이유를 알고 싶습니다.

travis-ci에서 docker-front 이미지가 만들어지지 않아서 문의 드립니다.

[front-end 이미지 생성안되는 로그]

$ docker build --no-cache --pull -t travisci123/docker-frontend ./frontend
unable to prepare context: unable to evaluate symlinks in Dockerfile path: lstat /home/travis/build/travisci123/docker-multi-app-101/frontend/Dockerfile: no such file or directory

[befor_install: 부터 script:까지 로그]

0.00s$ echo "start creating an image with dockerfile"
before_install.2
70.74s$ docker build -t travisci123/react-multi-app-101 -f ./frontend/Dockerfile.dev ./frontend
before_install.3
0.00s$ echo "start creating an image with dockerfile"
before_install.4
67.20s$ docker build --no-cache --pull -t travisci123/react-multi-app-101 -f ./frontend/Dockerfile.dev ./frontend
3.42s$ docker run -e CI=true travisci123/react-multi-app-101 npm run test
> frontend@0.1.0 test
> react-scripts test
PASS src/App.test.js
  ✓ renders learn react link (2 ms)
Test Suites: 1 passed, 1 total
Tests:       1 passed, 1 total
Snapshots:   0 total
Time:        1.61 s
Ran all test suites.
The command "docker run -e CI=true travisci123/react-multi-app-101 npm run test" exited with 0.
3.42s$ docker run -e CI=true travisci123/react-multi-app-101 npm run test
> frontend@0.1.0 test
> react-scripts test
PASS src/App.test.js
  ✓ renders learn react link (1 ms)

$ docker build --no-cache --pull -t travisci123/docker-frontend ./frontend
unable to prepare context: unable to evaluate symlinks in Dockerfile path: lstat /home/travis/build/travisci123/docker-multi-app-101/frontend/Dockerfile: no such file or directory

 

 

 

 

 

travis.yml aws travis docker github cicd 데이터 엔지니어링 travis-ci

답변 1

0

John Ahn

안녕하세요 ~ 

Dockerfile 이 다르기 때문에 이미지 이름이 다를수밖에 없습니다 ~ 

before_install 에서는 Dockerfile.dev 를 사용하고  after_success에서는 Dockerfile을 사용합니다. 
그러기에 두개의 이름을 다르게 하는것은 맞습니다. 

에러로그를 보니깐 dockerfile이 없다고 하는데 혹시 dockerfile이 생략되었나요?!

0

쏭쏭2

안녕하세요.

이미지가 생성안되던 문제는 며칠전에 해결을 했었습니다.
Dockerfile이 있긴 했는데,
처음 commit 했을 때 파일명에 F가 대문자였고, 그래서 소문자로 파일명을 변경해서 다시 commit-> push 했는데도,
실제 aws beanstalk에서는 파일을 못찾는 문제가 있더라구요. 

그래서 파일을 삭제하고 commit->push하고, 다시 파일 생성해서 commit->push해서 이미지가 생성되지 않는 문제는 해결을 했습니다. 

before_install: 에서 image 빌드를 하는데,  ./frontend/Dockerfile.dev를 참고하도록 되어 있고, 
script: 에서 docker를 run을 해주는데요,
이 이미지로 도커를 실행하여 npm run test를 하는데 이건 travis-ci 에서 이미지로 컨테이너 생성하여 컨터이너 동작이 정상실행되는 지를 테스트하는 목적으로 넣어준 코드라고 보면 될까요? 

추가로,
travis-ci를 통해 AWS ECS에 배포하는 방법에 대해서 혹시 아시는 부분이 있다면 대략의 방향에 대해서 알려 주시면 감사하겠습니다((혹은 참고할 수 있을만한 곳 알려주셔도 감사하겠습니다)

travis-ci를 이용하지 않는 방법이어도 괜찮습니다.

감사합니다. 

Docker Containers간 통신 할 때 나타나는 에러 강의 질문

0

79

1

WINDOW + Vite를 사용하여 소스 코드 변경이 반영되지 않는 현상

0

79

1

도커 컨테이너 끼리 SSL 통신 시 문제가 생깁니다..

0

216

1

도표 강의 자료 사용이 불가합니다. (권한 문제)

0

136

1

Docker compose 관련 공유

0

141

1

트레비스가 유료화가 되어 테스트가 어려워 챕터8에서 고민중입니다.

0

79

1

강사님 혹시 vscode 어떤 테마 쓰시나요..?

0

285

1

The instance profile aws-elasticbeanstalk-ec2-role associated with the environment does not exist.

0

105

1

travis ci가 이제 유료화가 된 것 같습니다;;;

0

209

2

docker-compose up 에러 공유 드립니다

0

290

1

Elastic Beanstalk에서 도메인 클릭시 react 이미지가 안나오고 다른 화면이 나오는데

0

170

1

도커 빌드 시간이 너무 오래걸려요..

0

1055

2

docker-compose down 이후에도 containers에 redis가 남아 있는 이유

0

167

1

도커 볼륨이 작동이 안되는것 같아서 질문드립니다!

0

212

2

docker-compose 가 Docker Desktop 에서 빠진건가요? command not found 라고 뜨네요

0

277

1

Error response from daemon: The system cannot find the file specified.

0

219

1

draw.io 오류

0

647

1

Docker Volume 오류(reference, lowercase)

0

564

1

[섹션3 - 내가 만든 이미지 기억하기 쉬운 이름 주기] 네이밍/태그 에러

0

226

1

axios오류 문의드립니다!

0

333

1

node.js version

0

485

1

안녕하세요 마지막 강의 질문 있습니다.

0

435

1

Deploy를 계속 실패합니다.

3

1382

4

TravisCI에서 계속 에러가 납니다....

0

358

1