Giter VIP home page Giter VIP logo

dockerapi's Introduction

DockerAPI

This application serves as a small demonstration for accessing the Docker REST API using the Docker.DotNet nuget package

Pre-requisite

The application creates new containers for the docker image : vad1mo/hello-world-rest, so make sure that this image is already pulled to your local docker repository. Use the following command to pull the Image:

docker pull vad1mo/hello-world-rest:latest

Building/Running the application

The application is a very minimalistic Balzor app and is supposed to be built as a docker image. The best way would be to open the solution file in Visual Studio 19.0 and run the application in either Debug or Release mode selecting Docker as the runtime configuration.

Running the application standalone (not using Visual studio) - please follow the steps in sequence

  • Create the projects docker image

    • You must first build the application using docker build command - please refer to the docker documentation for more help regarding this. OR
    • An alternate way would be to run the application in Release mode (dont you forget to choose Docker as the runtime configuration) once using Visual Studio, this should create an image containercreationusingdockerapi:latest in the local docker repository. You can use the following image subsequently to run the docker container from the command line
  • Use the following command from a wsl linux terminal (git-bash would also do) to start the container docker run -dt -p 5000:80 -v "/var/run/docker.sock:/var/run/docker.sock" -e "ASPNETCORE_ENVIRONMENT=Development" -e "ASPNETCORE_URLS=http://+:80" -P --name containercreationusingdockerapi_manual containercreationusingdockerapi:latest

    • The application makes REST Api calls to the docker daemon using the unix socket so make sure that in the above command the daemon socket is volume mounted for the application to connect to.

Report Issues/ Request Enhancements

Please contact [email protected] for raising any issues or for adding more features. You can use the github facilities to raise any issues directly.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.