-
Notifications
You must be signed in to change notification settings - Fork 17
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
docker: add initial dockerfile and docs
Signed-off-by: Juraj Vijtiuk <[email protected]>
- Loading branch information
Showing
3 changed files
with
55 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
# syntax=docker/dockerfile:1.0.0-experimental | ||
FROM sysrepo/sysrepo-netopeer2:latest | ||
|
||
MAINTAINER [email protected] | ||
|
||
ENV DEBIAN_FRONTEND=noninteractive | ||
|
||
RUN apt-get update && apt-get install -y\ | ||
ssh \ | ||
libnl-3-dev \ | ||
libnl-route-3-dev \ | ||
libnl-nf-3-dev \ | ||
libnl-genl-3-dev | ||
|
||
WORKDIR /opt/dev | ||
|
||
RUN \ | ||
mkdir -m 0600 -p /root/.ssh && ssh-keyscan lab.sartura.hr >> ~/.ssh/known_hosts | ||
|
||
RUN \ | ||
--mount=type=secret,id=sshkey,dst=/root/.ssh/id_ed25519 git clone [email protected]:sysrepo/sysrepo-plugin-interfaces.git | ||
|
||
Run \ | ||
cd sysrepo-plugin-interfaces && mkdir build && cd build && \ | ||
git checkout master && \ | ||
cmake -DCMAKE_BUILD_TYPE="Debug" .. && \ | ||
make -j2 | ||
|
||
RUN \ | ||
sysrepoctl -i /opt/dev/sysrepo-plugin-interfaces/yang/[email protected] && \ | ||
sysrepoctl -i /opt/dev/sysrepo-plugin-interfaces/yang/[email protected] && \ | ||
sysrepoctl -i /opt/dev/sysrepo-plugin-interfaces/yang/[email protected] && \ | ||
sysrepoctl -i /opt/dev/sysrepo-plugin-interfaces/yang/ieee802-dot1q-types.yang && \ | ||
sysrepoctl -i /opt/dev/sysrepo-plugin-interfaces/yang/[email protected] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,20 @@ | ||
# build | ||
As the plugin is currently not open source, we need to clone from a private git server. | ||
|
||
To do that, docker buildkit is required, and a private SSH key | ||
with access to the plugin repo needs to be passed at build time. | ||
|
||
``` | ||
$ export DOCKER_BUILDKIT=1 | ||
$ docker build --progress=plain --secret id=sshkey,src=/home/user/.ssh/id_ed25519 -t sysrepo/interfaces-plugin -f Dockerfile . | ||
``` | ||
|
||
# run | ||
Since the plugin depends on systemd, we need to run the container with `CAP_SYS_ADMIN` privileges and mount the | ||
cgroups FS within the container. | ||
|
||
``` | ||
docker run -ti -v /sys/fs/cgroup:/sys/fs/cgroup:ro --cap-add SYS_ADMIN --name interfaces-plugin sysrepo/interfaces-plugin /sbin/init | ||
``` | ||
|
||
|