Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Dockerfile support #736

Closed
wants to merge 9 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
17 changes: 17 additions & 0 deletions .dockerignore
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
# The .dockerignore file excludes files from the container build process.
#
# https://docs.docker.com/engine/reference/builder/#dockerignore-file

# Exclude locally vendored dependencies.
vendor/

# Exclude "build-time" ignore files.
.dockerignore
.gcloudignore

# Exclude git history and configuration.
.gitignore

# Ignore Dockerfile itself
Dockerfile

14 changes: 14 additions & 0 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,14 @@
FROM golang as builder
WORKDIR /src
COPY . .
RUN make bin-docker

FROM golang as runtime
WORKDIR /config
EXPOSE 4242/udp
COPY --from=builder /src/build/linux-amd64/nebula /app/

VOLUME ["/config"]

ENTRYPOINT ["/app/nebula"]
CMD ["-config", "config.yaml"]
18 changes: 18 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -114,6 +114,24 @@ To build nebula for a specific platform (ex, Windows):

See the [Makefile](Makefile) for more details on build targets

## Docker
### Building Nebula Docker image from source

Ensure Docker is installed and clone this repo. Change to the nebula directory.

To build nebula Docker image:
```
docker build -t nebula .
```

### Running

To run nebula Docker image, ensure correct network permission is given and network is in **host** mode:
```
docker run -dt --name=nebula -v=/path/to/config/on/host:/config --cap-add=NET_ADMIN --network=host --device=/dev/net/tun --restart=unless-stopped <image>
```
Where **\<image\>** is either `nebula` if source built or image from provider like Dockerhub.

## Credits

Nebula was created at Slack Technologies, Inc by Nate Brown and Ryan Huber, with contributions from Oliver Fross, Alan Lam, Wade Simmons, and Lining Wang.
Expand Down