-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy path.dockerrc_arm64
88 lines (76 loc) · 1.88 KB
/
.dockerrc_arm64
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
#!/bin/bash
export DOCKER_REPO_USER=anldisr
etcd(){
local NODE1
NODE1=$LOCAL_IP
# Ports
local PORT0
local PORT1
PORT0=2379
PORT1=2380
# API version
local API_VERSION
API_VERSION=3
# Registry
local IMAGE
IMAGE="gcr.io/etcd-development/etcd:v3.5.1-arm64"
docker run -d \
-p ${PORT0}:${PORT0} \
-p ${PORT1}:${PORT1} \
-e ETCD_ENABLE_V${API_VERSION}=true \
-e ETCDCTL_API=${API_VERSION} \
-v /tmp/etcd-data.tmp,destination=/etcd-data \
--name etcd \
"${IMAGE}" \
/usr/local/bin/etcd \
--name node0 \
--data-dir /etcd-data \
--initial-advertise-peer-urls "http://${NODE1}:${PORT1}" \
--listen-peer-urls "http://0.0.0.0:${PORT1}" \
--advertise-client-urls "http://${NODE1}:${PORT0}" \
--listen-client-urls "http://0.0.0.0:${PORT0}" \
--initial-cluster "node0=http://${NODE1}:${PORT1}"
}
etcdctl() {
local IMAGE
IMAGE="etcdctl"
local TAG
TAG="arm64v8-debian-bullseye-slim"
docker run -it --rm \
-e ETCDCTL_API=3 \
"$DOCKER_REPO_USER"/"$IMAGE":"$TAG" \
--endpoints="$LOCAL_IP":2379 \
"$@"
}
nmap(){
local IMAGE
IMAGE=nmap
local TAG
TAG="arm64v8-debian-bullseye-slim"
docker run --rm -it \
--net host \
"${DOCKER_REPO_USER}"/"$IMAGE":"$TAG" "$@"
}
jupyter(){
local IMAGE
IMAGE="jupyter-base-notebook"
local TAG
TAG="arm64v8-debian-bullseye-slim-latest"
PORT=8888
local LOCAL_VOLUME
LOCAL_VOLUME="$HOME/jupyter/notebooks"
local TOKEN
TOKEN=local
# Allow to run sudo in the container
local SUDO
SUDO=no
docker run -d --rm \
-p $PORT:$PORT \
--name jupyter \
-v "$LOCAL_VOLUME":/home/jovyan/notebooks \
-e GRANT_SUDO=${SUDO} \
"${DOCKER_REPO_USER}"/"$IMAGE":"$TAG" \
jupyter notebook --NotebookApp.token=${TOKEN} && \
sleep 1 && \
open http://localhost:8888/?token=${TOKEN}
}