Docker: Difference between revisions

108 bytes added ,  31 August 2023
m
no edit summary
m →‎Resources: Containerize an application
mNo edit summary
 
Line 1: Line 1:
Copy files to/from container
Copy files to/from container


<source lang="console">
<syntaxhighlight lang="console">
$ docker cp myfile.txt container_name:/srv/www/folder/
$ docker cp myfile.txt container_name:/srv/www/folder/
</source>
</syntaxhighlight>


List images
List images


<source lang="bash">
<syntaxhighlight lang="bash">
$ docker images
$ docker images
</source>
</syntaxhighlight>


Tag an image
Tag an image


<source lang="bash">
<syntaxhighlight lang="bash">
$ docker tag 7d9495d03763 maryatdocker/docker-whale:latest
$ docker tag 7d9495d03763 maryatdocker/docker-whale:latest
</source>
</syntaxhighlight>


Log-in for push/pull operations
Log-in for push/pull operations


<source lang="bash">
<syntaxhighlight lang="bash">
$ docker login --username=username --email=joe@mosh.com
$ docker login --username=username --email=joe@mosh.com
</source>
</syntaxhighlight>


Push image
Push image


<source lang="bash">
<syntaxhighlight lang="bash">
$ docker push maryatdocker/docker-whale
$ docker push maryatdocker/docker-whale
</source>
</syntaxhighlight>


Remove an image
Remove an image


<source lang="bash">
<syntaxhighlight lang="bash">
$ docker rmi -f imageid
$ docker rmi -f imageid
</source>
</syntaxhighlight>


== Resources ==
== Resources ==