Unverified 提交 3d2556fc authored 作者: Iñaki Baz Castillo's avatar Iñaki Baz Castillo 提交者: GitHub

Add Linux Alpine Docker image (#1226)

上级 93bbccf4
......@@ -154,8 +154,7 @@ Rewrites mediasoup-worker C++ files using [clang-format](https://clang.llvm.org/
Builds and runs the `mediasoup-worker-test` binary at `worker/out/Release/` (or at `worker/out/Debug/` if the "MEDIASOUP_BUILDTYPE" environment variable is set to "Debug"), which uses [Catch2](https://github.com/catchorg/Catch2) to run test units located at `worker/test/` folder.
### 'make test-asan'
### `make test-asan`
Run test with Address Sanitizer.
......@@ -189,7 +188,7 @@ Runs all fuzzer cases.
### `make docker`
Builds a Linux image with fuzzer capable clang++.
Builds a Linux Ubuntu Docker image with fuzzer capable clang++ and all dependencies to run mediasoup.
**NOTE:** Before running this command, a specific version of Linux clang must be downloaded. To get it, run:
......@@ -200,4 +199,16 @@ cd worker
### `make docker-run`
Runs a container of the Docker image created with `make docker`. It automatically executes a `bash` session in the `/mediasoup` directory, which is a Docker volume that points to the real `mediasoup` directory.
Runs a container of the Ubuntu Docker image created with `make docker`. It automatically executes a `bash` session in the `/mediasoup` directory, which is a Docker volume that points to the real `mediasoup` directory.
**NOTE:** To install and run mediasoup in the container, previous installation (if any) must be properly cleaned by entering the `worker` directory and running `make clean-all`.
### `make docker-alpine`
Builds a Linux Alpine Docker image with all dependencies to run mediasoup.
### `make docker-alpine-run`
Runs a container of the Alpine Docker image created with `make docker-alpine`. It automatically executes an `ash` session in the `/mediasoup` directory, which is a Docker volume that points to the real `mediasoup` directory.
**NOTE:** To install and run mediasoup in the container, previous installation (if any) must be properly cleaned by entering the `worker` directory and running `make clean-all`.
......@@ -5,24 +5,24 @@ RUN \
set -x \
&& apt-get update \
&& apt-get install --yes \
bash-completion wget curl subversion screen gcc g++ cmake ninja-build golang \
autoconf libtool apache2 python3-pip python3-dev pkg-config zlib1g-dev \
libgss-dev libssl-dev libxml2-dev nasm libarchive-dev make automake \
libdbus-1-dev libboost-dev autoconf-archive bash-completion python3-yaml \
clang
bash-completion wget curl subversion screen gcc g++ cmake ninja-build golang \
autoconf libtool apache2 python3-pip python3-dev pkg-config zlib1g-dev \
libgss-dev libssl-dev libxml2-dev nasm libarchive-dev make automake \
libdbus-1-dev libboost-dev autoconf-archive bash-completion python3-yaml \
clang
# Install node 20.
RUN set -x \
&& apt-get update \
&& apt-get install --yes ca-certificates curl gnupg \
&& mkdir -p /etc/apt/keyrings \
&& curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key \
| gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \
&& NODE_MAJOR=20 \
&& echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" \
> /etc/apt/sources.list.d/nodesource.list \
&& apt-get update \
&& apt-get install nodejs --yes
RUN set -x \
&& apt-get update \
&& apt-get install --yes ca-certificates curl gnupg \
&& mkdir -p /etc/apt/keyrings \
&& curl -fsSL https://deb.nodesource.com/gpgkey/nodesource-repo.gpg.key \
| gpg --dearmor -o /etc/apt/keyrings/nodesource.gpg \
&& NODE_MAJOR=20 \
&& echo "deb [signed-by=/etc/apt/keyrings/nodesource.gpg] https://deb.nodesource.com/node_$NODE_MAJOR.x nodistro main" \
> /etc/apt/sources.list.d/nodesource.list \
&& apt-get update \
&& apt-get install nodejs --yes
# Make CC and CXX point to clang/clang++ installed above.
ENV LANG="C.UTF-8"
......
FROM alpine
# Install dependencies.
RUN \
set -x \
&& apk add \
nodejs-current npm python3 py3-pip \
make gcc g++
# Make CC and CXX point to gcc/g++.
ENV LANG="C.UTF-8"
ENV CC="gcc"
ENV CXX="g++"
WORKDIR /mediasoup
CMD ["ash"]
......@@ -87,7 +87,9 @@ endif
fuzzer \
fuzzer-run-all \
docker \
docker-run
docker-run \
docker-alpine \
docker-alpine-run
default: mediasoup-worker
......@@ -266,3 +268,18 @@ docker-run:
--cap-add SYS_PTRACE \
-v $(shell pwd)/../:/mediasoup \
mediasoup/docker:latest
docker-alpine:
ifeq ($(DOCKER_NO_CACHE),true)
$(DOCKER) build -f Dockerfile.alpine --no-cache --tag mediasoup/docker-alpine:latest .
else
$(DOCKER) build -f Dockerfile.alpine --tag mediasoup/docker-alpine:latest .
endif
docker-alpine-run:
$(DOCKER) run \
--name=mediasoupDockerAlpine -it --rm \
--privileged \
--cap-add SYS_PTRACE \
-v $(shell pwd)/../:/mediasoup \
mediasoup/docker-alpine:latest
Markdown 格式
0% 或
您添加了 0 人 到此讨论。请谨慎行事。
请先完成此评论的编辑!
请 注册 或者 后发表评论