Skip to content

Commit 94c8d3a

Browse files
committed
2 parents d2598b2 + abb1022 commit 94c8d3a

File tree

3 files changed

+51
-102
lines changed

3 files changed

+51
-102
lines changed

.bashrc

+26-51
Original file line numberDiff line numberDiff line change
@@ -1,71 +1,48 @@
1-
# nano ~/.bashrc
2-
# run 'source ~/.bashrc' to load latest changes in current session
3-
4-
# ALIASES #####################################################
5-
# Note that these aliases do not work on Synology docker, due to the fact that they are a number of versions behind. (change "docker compose" to "docker-compose" and then it should work)
1+
##################################################################
62

3+
# run 'source ~/.bashrc' to load latest changes in current session
74

8-
########## Set docker aliases
9-
#
5+
# ALIASES ########################################################
6+
# Note that these aliases do not work on Synology docker, due to the fact that they are a number of versions behind. (c>
107

11-
# basic change folder command
12-
alias cdkr='cd ~/docker'
8+
# Set docker aliases
9+
alias dive='docker run -ti --rm -v /var/run/docker.sock:/var/run/docker.sock wagoodman/dive'
10+
alias cdkr='cd ~/docker'
1311
alias cdcd='cd ~/code/dockerholics/compose-examples'
14-
15-
# list all containers in a formatted list
16-
alias list='docker ps -a --format "table {{.Names}}\t{{.ID}}\t{{.Image}}\t{{.Status}}" | (read -r; printf "%s\n" "$REPLY"; sort -k 1 )'
17-
18-
# stop and remove all containers in your compose file. Optional to add a single container name
12+
alias list='docker ps -a --format "table {{.Names}}\t{{.ID}}\t{{.Status}}" | (read -r; printf "%s\n" "$REPLY"; sort -k >
1913
alias down='docker compose down -v'
20-
21-
# pull latest images in your compose file. Optional to add a single container name
2214
alias pull='docker compose pull'
23-
24-
# start all containers in your compose file. Optional to add a single container name
2515
alias up='docker compose up -d'
26-
27-
# inspect the details for a given container
2816
alias inspect='docker inspect'
29-
30-
# create, but dont start, all containers in your compose file. Optional to add a single container name
3117
alias create='docker compose up --no-start'
32-
33-
# stop a specific container
3418
alias stop='docker stop'
35-
36-
# stop all containers
37-
alias stopall='docker stop $(docker ps -a -q)'
38-
39-
# start all containers
4019
alias startall='docker start $(docker ps -a -q)'
41-
42-
# start a specific container
20+
alias stopall='docker stop $(docker ps -a -q)'
4321
alias start='docker start'
44-
45-
# Remove all images and volumes that are not in use. *including stopped containers*
4622
alias prune='docker system prune -a --volumes'
47-
48-
# delete a stopped container
4923
alias del='docker rm'
50-
51-
# restart a container
52-
alias cycle='docker restart'
53-
54-
# show the logs for a specific container
5524
alias logs='docker logs -f'
56-
57-
# show host disk use for docker
5825
alias ddf='docker system df'
5926
60-
# rename a specified container
61-
alias rename='docker rename'
27+
# Set other aliases
28+
alias ver='cat /etc/os-release && uname -mrs && docker -v && docker compose version'
29+
alias osupgrade='sudo do-release-upgrade'
30+
alias upgrade='sudo apt-get update && sudo apt-get upgrade -y && sudo apt autoremove --purge -y'
31+
alias topsize='sudo du -Sha | sort -rh | head -n 10'
32+
33+
6234
6335
# FUNCTIONS ####################################################
64-
#
6536
66-
# run a command inside a given container. Pass a single command or encapsulate in "" for a command with a parameter
37+
# run a command inside a given container
6738
drun() {
68-
docker exec $1
39+
docker exec $1 $2
40+
}
41+
42+
# Restarts a container
43+
#
44+
cycle() {
45+
docker restart $1
6946
}
7047
7148
# pulls a image and then creates and starts it
@@ -99,10 +76,8 @@ piu() {
9976
sudo netstat -plan | grep ":$1"
10077
}
10178
102-
103-
10479
# ENVIRONMENT SETTINGS ##########################################
80+
#
10581
# Helps avoid timeouts for large yaml scripts
106-
10782
export DOCKER_CLIENT_TIMEOUT=360
108-
export COMPOSE_HTTP_TIMEOUT=360
83+
export COMPOSE_HTTP_TIMEOUT=360

.bashrc-syno

+24-50
Original file line numberDiff line numberDiff line change
@@ -1,70 +1,46 @@
1-
# nano ~/.bashrc
2-
# run 'source ~/.bashrc' to load latest changes in current session
3-
4-
# ALIASES #####################################################
5-
# Note that these aliases do not work on Synology docker, due to the fact that they are a number of versions behind. (change "docker compose" to "docker-compose" and then it should work)
6-
7-
8-
########## Set docker aliases
9-
# Synology version
1+
##################################################################
102

11-
# basic change folder command
12-
alias cdkr='cd /volume1/docker'
3+
# run 'source ~/.bashrc' to load latest changes in current session
134

14-
# list all containers in a formatted list
15-
alias list='docker ps -a --format "table {{.Names}}\t{{.ID}}\t{{.Image}}\t{{.Status}}" | (read -r; printf "%s\n" "$REPLY"; sort -k 1 )'
5+
# ALIASES ########################################################
6+
# Note that these aliases are for Synology docker
167

17-
# stop and remove all containers in your compose file. Optional to add a single container name
8+
# Set docker aliases
9+
alias dive='docker run -ti --rm -v /var/run/docker.sock:/var/run/docker.sock wagoodman/dive'
10+
alias cdkr='cd ~/docker'
11+
alias cdcd='cd ~/code/dockerholics/compose-examples'
12+
alias list='docker ps -a --format "table {{.Names}}\t{{.ID}}\t{{.Status}}" | (read -r; printf "%s\n" "$REPLY"; sort -k >
1813
alias down='docker-compose down -v'
19-
20-
# pull latest images in your compose file. Optional to add a single container name
2114
alias pull='docker-compose pull'
22-
23-
# start all containers in your compose file. Optional to add a single container name
2415
alias up='docker-compose up -d'
25-
26-
# inspect the details for a given container
2716
alias inspect='docker inspect'
28-
29-
# create, but dont start, all containers in your compose file. Optional to add a single container name
3017
alias create='docker-compose up --no-start'
31-
32-
# stop a specific container
3318
alias stop='docker stop'
34-
35-
# stop all containers
36-
alias stopall='docker stop $(docker ps -a -q)'
37-
38-
# start all containers
3919
alias startall='docker start $(docker ps -a -q)'
40-
41-
# start a specific container
20+
alias stopall='docker stop $(docker ps -a -q)'
4221
alias start='docker start'
43-
44-
# Remove all images and volumes that are not in use. *including stopped containers*
4522
alias prune='docker system prune -a --volumes'
46-
47-
# delete a stopped container
4823
alias del='docker rm'
49-
50-
# restart a container
51-
alias cycle='docker restart'
52-
53-
# show the logs for a specific container
5424
alias logs='docker logs -f'
55-
56-
# show host disk use for docker
5725
alias ddf='docker system df'
5826

59-
# rename a specified container
60-
alias rename='docker rename'
27+
# Set other aliases
28+
alias ver='cat /etc/os-release && uname -mrs && docker -v && docker compose version'
29+
alias topsize='sudo du -Sha | sort -rh | head -n 10'
30+
31+
6132

6233
# FUNCTIONS ####################################################
63-
#
6434

65-
# run a command inside a given container. Pass a single command or encapsulate in "" for a command with a parameter
35+
# run a command inside a given container
6636
drun() {
67-
docker exec $1
37+
docker exec $1 $2
38+
}
39+
40+
# Restarts a container
41+
#
42+
cycle() {
43+
docker restart $1
6844
}
6945

7046
# pulls a image and then creates and starts it
@@ -98,10 +74,8 @@ piu() {
9874
sudo netstat -plan | grep ":$1"
9975
}
10076

101-
102-
10377
# ENVIRONMENT SETTINGS ##########################################
78+
#
10479
# Helps avoid timeouts for large yaml scripts
105-
10680
export DOCKER_CLIENT_TIMEOUT=360
10781
export COMPOSE_HTTP_TIMEOUT=360

compose-examples/docker/compose.yaml

+1-1
Original file line numberDiff line numberDiff line change
@@ -44,7 +44,7 @@ services:
4444
WATCHTOWER_CLEANUP: "true"
4545
WATCHTOWER_INCLUDE_STOPPED: "true"
4646
WATCHTOWER_POLL_INTERVAL: $WT_INTERVAL
47-
WATCHTOWER_TIMEOUT: 15
47+
WATCHTOWER_TIMEOUT: 15s
4848
WATCHTOWER_NOTIFICATIONS_LEVEL: info
4949
WATCHTOWER_HTTP_API_METRICS: "true"
5050
WATCHTOWER_HTTP_API_TOKEN: $WATCHTOWER_API_TOKEN

0 commit comments

Comments
 (0)