InfoHeap
Tech
Navigation
  • Home
  • Tutorials
    • CSS tutorials & examples
    • CSS properties
    • Javascript cookbook
    • Linux/Unix Command Line
    • Mac
    • PHP
      • PHP functions online
      • PHP regex
    • WordPress
  • Online Tools
    • Text utilities
    • Online Lint Tools
search
  • Home
  • > Kubernetes

Mac docker – create getting-started image and run container using it

on Jan 1, 2023

This tutorial will cover steps to create a docker image for getting-started code and run a container with it.

  1. Run a container and clone getting-started repo
    docker run --name repo alpine/git clone https://github.com/docker/getting-started.git
  2. Create the pod
    docker cp repo:/git/getting-started/ .
  3. Build the docker101tutorial image
    cd getting-started
    docker build -t docker101tutorial .
  4. Run a container using the image (also publish port 80 to 8001)
    docker run -d -p 8001:80 --name docker-tutorial docker101tutorial
  5. Access the site http://localhost:8081/
  6. To get a shell to the container, run the following
    docker exec -it docker-tutorial /bin/sh

Suggested posts:

  1. Docker how to add a user to group docker on Linux
  2. Docker container – handy commands
  3. node – how to find source file location of a module
  4. Mac – enable and use kubernetes in docker
  5. Mac – create a one container pod and get shell to it
  6. Mac kubernetes – create two container pod with shared volume
  7. LXC (Linux Containers) – quick start tutorial on Ubuntu
  8. Chrome extension tutorial – access active page dom
Share this article: share on facebook share on linkedin tweet this submit to reddit
Posted in Tutorials | Tagged Kubernetes, Mac Docker
  • Browse content
  • Article Topics
  • Article archives
  • Contact Us
Popular Topics: Android Development | AngularJS | Apache | AWS and EC2 | Bash shell scripting | Chrome developer tools | Company results | CSS | CSS cookbook | CSS properties | CSS Pseudo Classes | CSS selectors | CSS3 | CSS3 flexbox | Devops | Git | HTML | HTML5 | Java | Javascript | Javascript cookbook | Javascript DOM | jQuery | Kubernetes | Linux | Linux/Unix Command Line | Mac | Mac Command Line | Mysql | Networking | Node.js | Online Tools | PHP | PHP cookbook | PHP Regex | Python | Python array | Python cookbook | SEO | Site Performance | SSH | Ubuntu Linux | Web Development | Webmaster | Wordpress | Wordpress customization | Wordpress How To | Wordpress Mysql Queries | InfoHeap Money

Copyright © 2025 InfoHeap.

Powered by WordPress