From 2a265f5ee50c9970b1ddd0d507586ffd43bc5db8 Mon Sep 17 00:00:00 2001 From: Varban Andreev Date: Mon, 11 May 2020 19:39:11 +0300 Subject: [PATCH] Update readme --- Tasks/5.Using volumes/README.md | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/Tasks/5.Using volumes/README.md b/Tasks/5.Using volumes/README.md index 0aae573..7ca63ed 100644 --- a/Tasks/5.Using volumes/README.md +++ b/Tasks/5.Using volumes/README.md @@ -1,17 +1,17 @@ # Practice - using volumes -Run a container "mypsql" using **postgres:12** with options to: - - run the container in detached mode - - pass an environment variable `POSTGRES_PASSWORD=secretpass` - - create a named volume with `-v :/var/lib/postgresql/data` +Run a container **mypsql** using **postgres:12** with options to: + - run in detached mode + - pass the appropriate environment variable (find it on https://hub.docker.com/) + - use a named volume -Run a shell in the container and use psql to add a table and a record: +Run bash in the container and use psql to add a table and a record: - $ `psql -U postgres` - $ `create table public.films (id int PRIMARY KEY, name varchar(255));` - $ `insert into films(id, name) values(1, 'Some movie');` -Exit the container and delete it. Run a new container with the same options. Use ***the same*** volume name to re-use the existing volume. +Exit the container and delete it. Run a new container with the same options (use ***the same*** volume name). -Run a shell inside the container and see if your data is still there: +Run bash inside the new container and see if your data has survived: - $ `psql –U postgres` - $ `select * from public.films;`