mirror of https://github.com/aminya/setup-cpp
docs: update the readme docker [skip ci]
This commit is contained in:
parent
acb5fbf162
commit
e982b8598f
24
README.md
24
README.md
|
@ -179,7 +179,8 @@ jobs:
|
|||
Here is an example for using setup_cpp to make a builder image that has the Cpp tools you need.
|
||||
|
||||
```dockerfile
|
||||
FROM ubuntu:devel
|
||||
#### Base Image
|
||||
FROM ubuntu:devel AS base
|
||||
|
||||
# add setup_cpp
|
||||
WORKDIR "/"
|
||||
|
@ -189,12 +190,25 @@ RUN wget --no-verbose "https://github.com/aminya/setup-cpp/releases/download/v0.
|
|||
RUN chmod +x ./setup_cpp_linux
|
||||
|
||||
# install llvm, cmake, ninja, and ccache
|
||||
RUN ./setup_cpp_linux --compiler llvm --cmake true --ninja true --ccache true
|
||||
|
||||
# activate cpp environment variables
|
||||
RUN source ~/.cpprc
|
||||
RUN ./setup_cpp_linux --compiler llvm --cmake true --ninja true --ccache true --vcpkg true --make true
|
||||
|
||||
CMD source ~/.cpprc
|
||||
ENTRYPOINT [ "/bin/bash" ]
|
||||
|
||||
#### Building
|
||||
FROM base AS builder
|
||||
ADD ./dev/cpp_vcpkg_project /home/app
|
||||
WORKDIR /home/app
|
||||
RUN bash -c 'source ~/.cpprc \
|
||||
&& make build'
|
||||
|
||||
### Running environment
|
||||
# use a distroless image or ubuntu:devel if you wish
|
||||
FROM gcr.io/distroless/cc
|
||||
# copy the built binaries and their runtime dependencies
|
||||
COPY --from=builder /home/app/build/my_exe/Release/ /home/app/
|
||||
WORKDIR /home/app/
|
||||
ENTRYPOINT ["./my_exe"]
|
||||
```
|
||||
|
||||
See [this folder](https://github.com/aminya/setup-cpp/tree/master/dev/docker), for some dockerfile examples.
|
||||
|
|
|
@ -22,6 +22,7 @@ RUN bash -c 'source ~/.cpprc \
|
|||
&& make build'
|
||||
|
||||
### Running environment
|
||||
# use a distroless image or ubuntu:devel if you wish
|
||||
FROM gcr.io/distroless/cc
|
||||
# copy the built binaries and their runtime dependencies
|
||||
COPY --from=builder /home/app/build/my_exe/Release/ /home/app/
|
||||
|
|
|
@ -21,6 +21,7 @@ RUN bash -c 'source ~/.cpprc \
|
|||
&& make build'
|
||||
|
||||
### Running environment
|
||||
# use a distroless image or ubuntu:devel if you wish
|
||||
FROM gcr.io/distroless/cc
|
||||
# copy the built binaries and their runtime dependencies
|
||||
COPY --from=builder /home/app/build/my_exe/Release/ /home/app/
|
||||
|
|
|
@ -29,6 +29,7 @@ RUN bash -c 'source ~/.cpprc \
|
|||
&& make build'
|
||||
|
||||
### Running environment
|
||||
# use a distroless image or ubuntu:20.04 if you wish
|
||||
FROM gcr.io/distroless/cc
|
||||
# copy the built binaries and their runtime dependencies
|
||||
COPY --from=builder /home/app/build/my_exe/Release/ /home/app/
|
||||
|
|
Loading…
Reference in New Issue