docker pull image - download particular library(postgres) in container as image
sudo docker ps - shows all running containers
docker images - shows all images(libraries) running in container
sudo docker run - starts new container with new id
docker stop <container id> - stop the running container
docker start <container id> - start existing container again
docker ps -a - shows all running and stopped containers
docker run <image:version> - pull the image and start container
docker run -p<host port>:<container port default is 6379> - it run container at
particular host port
Note:- one host port can run only one container but same container port can
assigned for different host ports.
docker logs <container id> -f - live logs of the container
docker run --name - create container with specific name
docker exec -it <container_id> /bin/bash - for debugging container seeing all
stuffs running fine
|_ env - it shows environmental variables in container
docker network create <network_name> - creates isolated network where multiple
container can run and intereact with each other with only container_id
docker run -p <port:port> --name <name container> --net <network name> - run
particular container at port and inside network
docker-compose -f <docker-compose.yaml> up - it will start all continers and port
defined inside the file
sudo docker exec -it <container id> sh - go inside docker container and check all
files
docker rm <container id> - remove container
docker rmi <image id> - remove image
docker build -t <image_name:tag> - using docker compose and Dockerfile container
and image will be build with proper tag
sudo docker-compose up -d --build - building docker container using docker-compose
file
sudo systemctl restart docker - it will restart the docker in the server
Images of docker container has to pushed to registery so that we can directly pull
it and use that :- platforms are AWS ECR , Docker hub
docker login - it will login to by default docker hub repository
docker tag <application name>:<tag> <platform repository>/<application name>:<tag>
- it will create image tag to push image and platform repository will specify
platform otherwise by defualt it pushed to docker hub
docker push <tagged image name><tag> - it will push image to particular platform
docker pull <tagged image name> - it will pull the image to your server where you
want to run that application and then use docker to run command to run it at some
port and name
docker volume mounting - mounting physical (server) directory path with path inside
of container directory which replicated changes in data both side example :- model
files , captured audio files etc
|__ volume : /path of server directory : /path inside container
Name: Flask
Version: 2.0.3
Name: Flask-Migrate
Version: 2.6.0
"""
new = []
f = open('NSD-Malayalam-Malayalam-0725-0735-201971784937\\transcriptions.txt',
encoding="utf8")
for i in f:
spl1 = i.split('\n')
new.append(spl1)
id_folder = 'NSD-Malayalam-Malayalam-0725-0735-201971784937'
id_transcript = pd.DataFrame(columns=['id','transcribe'])
id = []
transcribe = []
def extract_transcibe(str):
session_id = re.sub(r'[0-9]+','', str)
return session_id
for i in new:
if i:
record = i[0].split(',')
if record[0] !='0':
id.append(int(record[2].strip()))
extracted_transcibe = extract_transcibe(record[1]).strip()
transcribe.append(extracted_transcibe)
id_transcript['id'] = id
id_transcript['transcribe'] = transcribe
filtered_path = []
filtered_id = []
filtered_transcribe = []
for i in path_id['path']:
subfolder_path = i.split('/')[0]
if subfolder_path==id_folder:
filtered_path.append(i)
store_id = path_id.loc[path_id['path']==i,'id'].iloc[0]
filtered_id.append(store_id)
import collections
duplicate_ids = [item for item, count in
collections.Counter(id_transcript['id']).items() if count > 1]
print(duplicate_ids)
for i in duplicate_ids:
id_transcript.drop(id_transcript[id_transcript['id']==i].index,inplace=True,axis=0)
filtered_df['path'] = filtered_path
filtered_df['id'] = filtered_id
for i in duplicate_ids:
filtered_df.drop(filtered_df[filtered_df['id']==i].index,inplace=True,axis=0)
for i in filtered_df['id']:
for j in id_transcript['id']:
if i==j:
store_transcript =
id_transcript.loc[id_transcript['id']==j,'transcribe'].iloc[0]
filtered_transcribe.append(store_transcript)
filtered_df['transcribe'] = filtered_transcribe
completed_dataframe = completed_dataframe.append(filtered_df,ignore_index = True)
print(completed_dataframe)
"""