Docker Community Forums

Share and learn in the Docker community.

Lboost_thread: No such file or directory

I want to build and run a C++ program that uses boost asio in a docker container.

My dockerfile:

FROM alpine:3.10 AS build
COPY . /usr/src/myapp
WORKDIR /usr/src/myapp

RUN apk --update add --no-cache \ build-base \ boost boost-dev && /usr/bin/g++ -o server main.cpp connection_manager.cpp connection.cpp mime_types.cpp reply.cpp request_handler.cpp request_parser.cpp server.cpp -lboost_system - lboost_thread -lpthread -std=c++11 -I/usr/include/boost

CMD ["./server"]

I write command $docker build . --tag web_server and get: get an error: g++: error: lboost_thread: No such file or directory
Why so?