GithubHelp home page GithubHelp logo

添加docker支持 about natmap HOT 5 OPEN

Lxeon avatar Lxeon commented on May 18, 2024 1
添加docker支持

from natmap.

Comments (5)

MikeWang000000 avatar MikeWang000000 commented on May 18, 2024

Thanks. 不过有一些建议可以作为参考:

  1. 可以采用多阶段 (Multi-stage builds) 的方式构建,这样可以避免把整个 GCC 打进镜像里面,减少镜像体积;
  2. NATMap 目前还没有内置 iptables 转发(虽然我曾提过这个事),NET_ADMIN NET_RAW 这两个权限还暂时用不到。

from natmap.

MikeWang000000 avatar MikeWang000000 commented on May 18, 2024

@heiher 另外不知是否有构建 Docker 镜像的规划?如果有我可以帮忙提个 PR。

from natmap.

Lxeon avatar Lxeon commented on May 18, 2024

Thanks. 不过有一些建议可以作为参考:

1. 可以采用多阶段 (Multi-stage builds) 的方式构建,这样可以避免把整个 GCC 打进镜像里面,减少镜像体积;

2. NATMap 目前还没有内置 iptables 转发(虽然我曾提过这个事),`NET_ADMIN` `NET_RAW` 这两个权限还暂时用不到。

更新

FROM ubuntu:latest as builder
ENV LANG        C.UTF-8
ENV LANGUAGE    C.UTF-8
ENV LC_ALL      C.UTF-8
RUN apt update \
    && apt upgrade -y \
    && apt install -y gcc git make curl \
    && git clone --recursive https://github.com/heiher/natmap.git \
    && cd natmap \
    && make \
    && cp ./bin/natmap /opt/natmap
FROM ubuntu:latest
RUN apt update \
    && apt upgrade -y \
    && apt install -y curl
COPY --from=builder /opt/natmap /opt/natmap
ENTRYPOINT ["/opt/natmap"]

感觉有些常用的命令也得加上去

from natmap.

heiher avatar heiher commented on May 18, 2024

@heiher 另外不知是否有构建 Docker 镜像的规划?如果有我可以帮忙提个 PR。

感谢 @Lxeon @MikeWang000000

如果能提个PR就太好了~ 有没有可能直接根据arch下载发布页由github action构建出来的二进制?那样会不会依赖简单一些

from natmap.

doyoman avatar doyoman commented on May 18, 2024

不编译,直接下载最新Releases的对应架构文件到alpine镜像就行吧,做好启动脚本和对应环境变量就ok,这样体积应该非常小

from natmap.

Related Issues (20)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.