Skip to content

asankov/intro-to-containers

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

7 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Intro to Containers

Code demos for the Intro to Containers presentation.

The demos are based on the aspnet-mysql application from this repo.

To learn more about Containers check out the slides.

Build and run the container

To build and run the application in this repo:

  1. Download and Install Docker Desktop

  2. Build the containers

    # go to the app folder
    $ cd app
    
    # build the container
    $ docker build -t aspnet .
    
    # run the container
    $ docker run -p 80:80 aspnet

    The -t aspnet option tags the image with the aspnet tag. This way we are naming the image, so that we can use it later.

    The -p 80:80 option maps the local port 80 to port 80 in the container.

Push the container to a registry

To push the container to a registry (for example, Docker Hub):

  1. Go to Docker Hub and create an account.

  2. Build the image again, but this time prefix the tag with your username:

    # go to the app folder
    $ cd app
    
    # build the container and tag it with your username
    docker build -t <username>/aspnet .
    
    # push the container via its tag
    docker push <username>/aspnet
  3. Login to Docker Hub with your username and password:

    $ docker login --username <username>
    Password: <enter_password>
  4. Push the image:

    docker push <username>/aspnet
  5. The image should now be visible in your Docker Hub account:

Screenshot from Docker Hub showing the image

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published