GithubHelp home page GithubHelp logo

grpc-client-cpp-docker's Introduction

Using Docker to build and deploy a C++ gRPC service

This sample demonstrates how to create a basic gRPC service in C++ and build it it using GCC and CMake in a Docker container. It also shows how to create a Docker image that contains only the service implementation, without the tools needed to build it. It is based on the Dockerfile used to build the official gRPC CXX image.

Build and run the sample

git clone https://github.com/npclaudiu/grpc-cpp-docker.git
cd grpc-cpp-docker
docker build -t calculator .
docker run --network host --rm -it calculator

To run the shell instead of starting the server hosting the calculator service you can use:

docker run --rm -it --entrypoint=bash calculator

First build will take some time, as it also clones, builds and installs protobuf and grpc. You should end up with a Docker image tagged calculator, based on Debian and containing the release build of the calculator service and all of its dependencies, all under /opt/calculator. There is also an intermediary build image, where the project is actually built. Please see the Dockerfile and the documentation for Docker multi-stage builds for more.

grpc-client-cpp-docker's People

Contributors

jnnnnn avatar npclaudiu avatar

Watchers

 avatar  avatar

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.