Skip to content
Branch: master
Find file Copy path
Find file Copy path
Fetching contributors…
Cannot retrieve contributors at this time
executable file 40 lines (30 sloc) 1.15 KB
# fresh slate
rm sybase_empty.tgz
rm fresh.cid
rm ct.cid
rm -rf sybase_data
mkdir sybase_data
# run base image docker build
cd base
docker build . -t sybase:base
# run base image with sybase mounted, execute; take note of container id
cd ..
docker run --cidfile fresh.cid -v $(pwd)/sybase_data:/var/sybase sybase:base
# commit container to image (via container id)
docker commit $container_id sybase:empty
# tar up sybase data -> sybase.empty.tgz -- so you can later restore an empty state
tar cvfz sybase_empty.tgz sybase_data
mv sybase_empty.tgz sybase_data_archives
cd fresh
docker build . -t sybase:fresh
cd ..
# now create the required tables -- these may change from time to time so we do it last
docker run -d --cidfile ct.cid -v $(pwd)/sybase_data:/var/sybase -v $(pwd)/create_tables:/create_tables sybase:fresh
docker exec $container_id bash -c 'chmod +x /create_tables/ ; /create_tables/'
docker stop $container_id
# and archive them for easy reuse
tar cvfz sybase_empty_tables.tgz sybase_data
mv sybase_empty_tables.tgz sybase_data_archives
You can’t perform that action at this time.