Docker: Difference between revisions

From RAJ INFO
Jump to navigation Jump to search
mNo edit summary
 
(8 intermediate revisions by the same user not shown)
Line 1: Line 1:
[[Category: Bioinformatics]] [[Category: Docker]]
[[Category: Bioinformatics]] [[Category: Docker]]
=Pull and create a container =  
=Creating a Docker =
 
* Create an application list to a text file
<pre>
apt list>text file
pip freeze >text file
conda freeze >text file
</pre>
 
* Create a "Dockerfile" for installation
 
<pre>
FROM ubuntu:24.04 # Installation of OS
RUN mkdir /test
WORKDIR /test
COPY list.txt .  # Application list
 
RUN apt update -y
RUN apt install python3-pip -y
RUN conda install anaconda -y
RUN conda install --break-system-packages -r list.txt
RUN pip install --break-system-packages jupyter
 
EXPOSE 8005 8006 8501  # Expose the ports that are to be opened
 
ENTRYPOINT ["jupyter-notebook","--port=8501"]  # First service to be run
</pre>
* Build the doker Image
<pre>
docker build -t test:V1 .  # Build the docker image
</pre>
=Copy Files IN/OUT/EXEC=  
<pre>
<pre>
docker pull arunindiran/biomass:V4
* From Docker to Outside | $ docker cp <containerID>:<source-path> /<destination-path>
docker run --name biomass -p 8501:8501 arunindiran/biomass:V4
* From Outside to Docker | $ docker cp <source-path> <container>:<destination-path>
docker run --name biomass -p 8501:8501 -p 8099:8001 arunindiran/biomass:V4
* Execute a command into docker from outside | $ docker exec -it <container> bash
</pre>
</pre>


=Making changes in the Docker =
<pre>
docker commit <ContainerID> <imageid:tag>
</pre>


=Push to Docker =  
=Push to Docker =  
Line 12: Line 47:
docker login
docker login
docker push curioadmin/biomass:V5
docker push curioadmin/biomass:V5
</pre>
=Pull and create a container =
<pre>
docker pull arunindiran/biomass:V6
docker run --name biomass -p 8501:8501 arunindiran/biomass:V6
docker run --name biomass -p 8501:8501 -p 8099:8000 arunindiran/biomass:V6
</pre>
</pre>

Latest revision as of 05:54, 11 December 2024

Creating a Docker

  • Create an application list to a text file
apt list>text file
pip freeze >text file
conda freeze >text file
  • Create a "Dockerfile" for installation
FROM ubuntu:24.04 # Installation of OS
RUN mkdir /test
WORKDIR /test
COPY list.txt .  # Application list

RUN apt update -y
RUN apt install python3-pip -y
RUN conda install anaconda -y
RUN conda install --break-system-packages -r list.txt
RUN pip install --break-system-packages jupyter

EXPOSE 8005 8006 8501  # Expose the ports that are to be opened

ENTRYPOINT ["jupyter-notebook","--port=8501"]  # First service to be run
  • Build the doker Image
docker build -t test:V1 .  # Build the docker image

Copy Files IN/OUT/EXEC

* From Docker to Outside | $ docker cp <containerID>:<source-path> /<destination-path>
* From Outside to Docker | $ docker cp <source-path> <container>:<destination-path> 
* Execute a command into docker from outside | $ docker exec -it <container> bash

Making changes in the Docker

docker commit <ContainerID> <imageid:tag>

Push to Docker

docker login
docker push curioadmin/biomass:V5


Pull and create a container

docker pull arunindiran/biomass:V6
docker run --name biomass -p 8501:8501 arunindiran/biomass:V6
docker run --name biomass -p 8501:8501 -p 8099:8000 arunindiran/biomass:V6