6장. Build Once와 artifact identity를 지킨다
staging에서 시험한 source를 production에서 다시 build하면 compiler, dependency repository, 시간, base image가 달라질 수 있다. 한 번 build하고 digest로 저장한 뒤 환경별 configuration만 바꿔 승격한다.
docker build --pull --tag registry.example/parceltrack:${GIT_SHA} .
docker push registry.example/parceltrack:${GIT_SHA}
docker inspect --format='{{index .RepoDigests 0}}' registry.example/parceltrack:${GIT_SHA}
명령 예시는 승인된 registry에서 실행한다. 운영 manifest에는 tag 대신 digest를 쓴다. source archive, JAR/WAR, container 모두 SHA-256과 metadata를 기록한다. artifact retention은 rollback window와 규제 보존을 고려한다. 지워진 artifact를 source에서 다시 만들 수 있다는 기대만으로 rollback을 설계하지 않는다.