Steps to run simple C program on Ubantu Docker image: 1. Following files needs to be created in Working Directory folder. hello.c Dockerfile 2. hello.c file contains c program with Hello, World! message printed out. 3. Dockerfile should contain below code FROM ubuntu:latest RUN apt-get update && apt-get install -y gcc COPY hello.c /app/hello.c WORKDIR /app RUN gcc -o hello hello.c CMD ["./hello"] 4. Build docker image using command " docker build -t my-hello-app ." 5. Once docker image is built, run the docker container using command "docker run my-hello-app" 6. Hello, World! will be printed out.
Steps to Run GCC Docker image on Raspberry pi: 1. Create folder with below contents: build --> Folder Dockerfile --> Docker image file main.c --> C Program 2. Write a simple c program into main.c file // C program to implement // the above approach #include <stdio.h> // Driver code int main() { printf("Welcome to Docker World!!!\n"); return 0; } 3. Edit Dockerfile and write below contents FROM gcc:latest COPY . /build WORKDIR /build/ RUN gcc -o main main.c CMD [“./main”] 4. Save and Build Dockerfile, using command "docker build -t main-gcc-app ." DEPRECATED: The legacy build...