Skip to content

Commit b5505ce

Browse files
committed
first commit
1 parent 4db575e commit b5505ce

File tree

4 files changed

+30
-0
lines changed

4 files changed

+30
-0
lines changed

CMakeLists.txt

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
cmake_minimum_required(VERSION 3.9)
2+
project(hello_docker)
3+
4+
set(CMAKE_CXX_STANDARD 14)
5+
set(SOURCE_FILES hello.cpp)
6+
7+
add_executable(testdocker_run ${SOURCE_FILES})

Dockerfile

+16
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,16 @@
1+
FROM ubuntu:latest
2+
3+
ARG DEBIAN_FRONTED=noninteractive
4+
5+
RUN apt-get -y update && apt-get install -y
6+
RUN apt-get -y install g++ cmake git
7+
8+
COPY . .
9+
10+
WORKDIR .
11+
12+
RUN mkdir ./build
13+
RUN cmake -B/build -S . -D CMAKE_BUILD_TYPE=Release
14+
RUN cmake --build /build
15+
16+
CMD ["./build/testdocker_run"]

hello

8.71 KB
Binary file not shown.

hello.cpp

+7
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,7 @@
1+
#include<iostream>
2+
using namespace std;
3+
4+
int main(void)
5+
{
6+
cout<<"hello world"<<endl;
7+
}

0 commit comments

Comments
 (0)