Skip to content

Commit edf4ff6

Browse files
committed
should work
1 parent da73a47 commit edf4ff6

File tree

4 files changed

+32
-0
lines changed

4 files changed

+32
-0
lines changed

README.md

+15
Original file line numberDiff line numberDiff line change
@@ -9,6 +9,21 @@ Vagrant
99
-------------------
1010
After the first boot, it should be manually reloaded via `Vagrant reload`.
1111

12+
====================
13+
Docker
14+
--------------------
15+
16+
1. Make sure docker is installed.
17+
2. If you are behind a proxy, modify `scripts/Dockerfile.dev` and `scripts/cargo-docker` to set proxy
18+
19+
```bash
20+
cd scripts
21+
bash build-dev-docker.sh
22+
source cargo-docker
23+
cd ..
24+
xcargo build
25+
```
26+
1227
### About the network cards
1328
The second network card is used for ipv4 testing, the third network card is used
1429
for test ipv6 settings, the last is used for modifiction.

scripts/Dockerfile.dev

+10
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,10 @@
1+
FROM ubuntu:22.04
2+
COPY inner /
3+
# ENV HTTPS_PROXY=http://192.168.1.81:10801
4+
# ENV HTTP_PROXY=http://192.168.1.81:10801
5+
# ENV ALL_PROXY=http://192.168.1.81:10801
6+
RUN apt update -y && apt upgrade -y && apt install -y curl build-essential git libudev-dev libnm-dev libsystemd-dev protobuf-compiler && apt autoremove -y && apt autoclean -y
7+
RUN bash -c "curl --proto '=https' --tlsv1.2 -sSf https://sh.rustup.rs | sh -s -- --default-toolchain nightly -y"
8+
RUN cp /docker-init/config /root/.cargo/config
9+
ENV PATH=/root/.cargo/bin:$PATH
10+
RUN git config --global --add safe.directory '*'

scripts/build-dev-docker.sh

+3
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,3 @@
1+
#! /usr/bin/env sh
2+
3+
docker build . -f Dockerfile.dev -t docker.io/ssfdust/orbuculum-dev:latest

scripts/cargo-docker

+4
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
#! /usr/bin/env sh
2+
# proxy="-e HTTPS_PROXY=http://192.168.1.81:10801 -e HTTP_PROXY=http://192.168.1.81:10801 -e ALL_PROXY=http://192.168.1.81:10801"
3+
alias xcargo="docker run --network=host --rm --name test $proxy -v '$(pwd):/work' -v '$HOME/.cargo/git:/root/.cargo/git:rw' -v '$HOME/.cargo/registry:/root/.cargo/registry:rw' --workdir /work -ti docker.io/ssfdust/orbuculum-dev cargo"
4+
alias xbash="docker run --network=host --rm --name test $proxy -v '$(pwd):/work' -v '$HOME/.cargo/git:/root/.cargo/git:rw' -v '$HOME/.cargo/registry:/root/.cargo/registry:rw' --workdir /work -ti docker.io/ssfdust/orbuculum-dev bash"

0 commit comments

Comments
 (0)