목록Docker (3)
4번독수리의 둥지
docker run -d --name postgres -v $(pwd)/data:/var/lib/postgresql/data -p 5432:5432 postgres:11.1 until [[ -f ./mounted/postgresql/data/postmaster.opts ]]; do sleep 1; done # do what I want. ex) create database, create table, ... 컨테이너의 /docker-entrypoint-initdb.d 디렉토리에 쉘스크립트를 mount하면 실행해준다! 이런 짓은 필요가 없다...
https://stackoverflow.com/questions/34496882/get-docker-container-id-from-container-name docker ps -aqf "name=^containername&" image도 repository, tag로 검색할 수 있다. https://docs.docker.com/engine/reference/commandline/images/ docker images --filter=reference='busy*:*libc' docker images --filter=reference='busy*:uclibc' --filter=reference='busy*:glibc'
FROM alpine:latest RUN apk --update add ca-certificates FROM scratch FROM can appear multiple times within a singleDockerfileto create multiple images or use one build stage as a dependency for another. Simply make a note of the last image ID output by the commit before each new FROM instruction. Each FROM instruction clears any state created by previous instructions. https://docs.docker.com/eng..