tree: 0e6240f626b361f7e482f32a59588592d10bd720 [path history] [tgz]
  1. .mvn/
  2. src/
  3. Dockerfile
  4. Dockerfile.jvm
  5. mvnw
  6. mvnw.cmd
  7. pom.xml
  8. README.md
2-advanced/dubbo-samples-native-image/dubbo-samples-native-image-consumer/README.md

Build native image

The following steps work for all platforms - MacOS, Windows, and Linux.

To do this, we've provided a multistage Docker build file for building a Docker image containing your native executable inside a Docker container.

Build the consumer

  1. Containerise the native executable using the following command:

    docker build -f ./Dockerfile --build-arg APP_FILE=dubbo-samples-native-image-consumer -t consumer-native:1.0.0 .
    
  2. Run the application:

    docker run --rm --name native-consumer consumer-native:1.0.0
    
  3. To stop the application, first get the container id using docker ps, and then run:

    docker rm -f <container_id>