Launcher --docker-args ignored?

I tried ./launcher stop app and then ./launcher start app --docker-args --memory="1g" and it doesn’t appear to pass --memory=“1g” to docker as docker stats still shows LIMIT = all ram of the machine.

Am I missing anything? Is there a prerecorded start command with flags for the docker image – i see that the launcher script simply does docker start app? I’m not a docker expert.

p.s. Running as bash -x launcher start app --memory="1g" shows that the testing command does have the --memory=1g flag, but the docker start command does not, it’s just plain docker start app:

<snip>

+ case "${1}" in
+ user_args_argv=--memory=1g
+ user_args=--memory=1g
+ shift

<snip>

++ /usr/bin/docker run --memory=1g -i --rm -a stdout -a stderr discourse/base:2.0.20231004-0028 echo working
+ test=working
+ [[ working =~ working ]]
+ :

<snip>

+ echo 'starting up existing container'
starting up existing container
+ set -x
+ /usr/bin/docker start app
app
+ exit 0

Full output:

# bash -x ./launcher start app --docker-args --memory="1g"
+ SAVED_ARGV=("$@")
+ command=start
+ config=app
+ user_args_argv=
+ user_args=
+ user_run_image=
+ [[ start == \r\u\n ]]
+ '[' 4 -gt 0 ']'
+ case "${1}" in
+ shift 1
+ '[' 3 -gt 0 ']'
+ case "${1}" in
+ shift 1
+ '[' 2 -gt 0 ']'
+ case "${1}" in
+ user_args_argv=--memory=1g
+ user_args=--memory=1g
+ shift
+ shift 1
+ '[' 0 -gt 0 ']'
+ '[' -z start -o -z app -a start '!=' cleanup ']'
+ re='[[:upper:]/ !@#$%^&*()+~`=]'
+ [[ app =~ [[:upper:]/ !@#$%^&*()+~`=] ]]
++ dirname ./launcher
+ cd .
+ pups_version=v1.0.3
+ docker_min_version=17.03.1
+ docker_rec_version=17.06.2
+ git_min_version=1.8.0
+ git_rec_version=1.8.0
+ kernel_min_version=4.4.0
+ config_file=containers/app.yml
+ cidbootstrap=cids/app_bootstrap.cid
+ local_discourse=local_discourse
+ image=discourse/base:2.0.20231004-0028
++ which docker.io
++ which docker
+ docker_path=/usr/bin/docker
++ which git
+ git_path=/usr/bin/git
+ '[' '' = true ']'
+ attach_on_run=-d
+ '[' -n '' ']'
++ which ip
+ '[' -x /sbin/ip ']'
++ ip addr show docker0
++ grep 'inet '
++ awk '{ split($2,a,"/"); print a[1] }'
+ docker_ip=172.17.0.1
+ '[' -z '' ']'
+ '[' start '!=' cleanup ']'
+ check_prereqs
+ '[' -z /usr/bin/docker ']'
++ /usr/bin/docker info
+ test='Client:
 Context:    default
 Debug Mode: false
 Plugins:
  app: Docker App (Docker Inc., v0.9.1-beta3)
  buildx: Docker Buildx (Docker Inc., v0.8.2-docker)

Server:
 Containers: 11
  Running: 6
  Paused: 0
  Stopped: 5
 Images: 12
 Server Version: 20.10.17
 Storage Driver: overlay2
  Backing Filesystem: extfs
  Supports d_type: true
  Native Overlay Diff: true
  userxattr: false
 Logging Driver: json-file
 Cgroup Driver: cgroupfs
 Cgroup Version: 1
 Plugins:
  Volume: local
  Network: bridge host ipvlan macvlan null overlay
  Log: awslogs fluentd gcplogs gelf journald json-file local logentries splunk syslog
 Swarm: inactive
 Runtimes: io.containerd.runc.v2 io.containerd.runtime.v1.linux runc
 Default Runtime: runc
 Init Binary: docker-init
 containerd version: 10c12954828e7c7c9b6e0ea9b0c02b01407d3ae1
 runc version: v1.1.2-0-ga916309
 init version: de40ad0
 Security Options:
  apparmor
  seccomp
   Profile: default
 Kernel Version: 5.4.0-166-generic
 Operating System: Ubuntu 20.04.6 LTS
 OSType: linux
 Architecture: x86_64
 CPUs: 2
 Total Memory: 3.734GiB
 Name: climb
 ID: MPKO:7IZM:ILYQ:EV6I:YOCZ:SC25:GGFT:2BSR:D4RV:6GLW:JHC6:M66F
 Docker Root Dir: /var/lib/docker
 Debug Mode: false
 Registry: https://index.docker.io/v1/
 Labels:
 Experimental: false
 Insecure Registries:
  127.0.0.0/8
 Live Restore Enabled: false'
+ [[ 0 -ne 0 ]]
+ /usr/bin/docker info
+ egrep -q 'Storage Driver: (btrfs|aufs|zfs|overlay2)$'
+ test=($($docker_path --version))
++ /usr/bin/docker --version
+ test=20.10.17
+ compare_version 17.03.1 20.10.17
+ [[ 17.03.1 == 20.10.17 ]]
+ local IFS=.
+ a=(${1%%[^0-9.]*})
+ b=(${2%%[^0-9.]*})
+ local i a b
+ local arem= brem=
+ (( i=0 ))
+ (( i<3 || i<3 ))
+ (( 10#17 < 10#20 ))
+ return 1
+ compare_version 17.06.2 20.10.17
+ [[ 17.06.2 == 20.10.17 ]]
+ local IFS=.
+ a=(${1%%[^0-9.]*})
+ b=(${2%%[^0-9.]*})
+ local i a b
+ local arem= brem=
+ (( i=0 ))
+ (( i<3 || i<3 ))
+ (( 10#17 < 10#20 ))
+ return 1
+ arm=false
+ case $(uname -m) in
++ uname -m
+ echo 'x86_64 arch detected.'
x86_64 arch detected.
++ /usr/bin/docker images
++ grep discourse/base:2.0.20231004-0028
++ awk '{print $1 ":" $2 }'
+ test=discourse/base:2.0.20231004-0028
+ '[' -z discourse/base:2.0.20231004-0028 ']'
+ '[' false = true ']'
+ test=($($git_path --version))
++ /usr/bin/git --version
+ test=2.25.1
+ compare_version 1.8.0 2.25.1
+ [[ 1.8.0 == 2.25.1 ]]
+ local IFS=.
+ a=(${1%%[^0-9.]*})
+ b=(${2%%[^0-9.]*})
+ local i a b
+ local arem= brem=
+ (( i=0 ))
+ (( i<3 || i<3 ))
+ (( 10#1 < 10#2 ))
+ return 1
+ compare_version 1.8.0 2.25.1
+ [[ 1.8.0 == 2.25.1 ]]
+ local IFS=.
+ a=(${1%%[^0-9.]*})
+ b=(${2%%[^0-9.]*})
+ local i a b
+ local arem= brem=
+ (( i=0 ))
+ (( i<3 || i<3 ))
+ (( 10#1 < 10#2 ))
+ return 1
+ test=($(uname -r))
++ uname -r
+ compare_version 4.4.0 5.4.0-166-generic
+ [[ 4.4.0 == 5.4.0-166-generic ]]
+ local IFS=.
+ a=(${1%%[^0-9.]*})
+ b=(${2%%[^0-9.]*})
+ local i a b
+ local arem= brem=-166-generic
+ (( i=0 ))
+ (( i<3 || i<3 ))
+ (( 10#4 < 10#5 ))
+ return 1
++ /usr/bin/docker run --memory=1g -i --rm -a stdout -a stderr discourse/base:2.0.20231004-0028 echo working
+ test=working
+ [[ working =~ working ]]
+ :
++ /usr/bin/docker info --format '{{.DockerRootDir}}'
+ folder=/var/lib/docker
+ safe_folder=/var/lib/docker
+ [[ -d /var/lib/docker ]]
++ stat -f '--format=%a*%S' /var/lib/docker
+ [[ 4281372*4096/1024**3 -lt 5 ]]
+ [[ ! -e containers/app.yml ]]
+ [[ ! -r containers/app.yml ]]
++ find containers/app.yml -perm -004
+ [[ -n '' ]]
+ '[' -z /usr/bin/docker ']'
+ '[' start == cleanup ']'
+ docker_version=($($docker_path --version))
++ /usr/bin/docker --version
+ docker_version=
+ restart_policy=--restart=always
+ case "$command" in
+ run_start
+ '[' -z '' ']'
++ /usr/bin/docker ps
++ awk '{ print $1 }'
++ grep ' app$'
++ awk '{ print $1, $(NF) }'
+ existing=
+ echo

+ '[' '!' -z ']'
++ /usr/bin/docker ps -a
++ awk '{ print $1 }'
++ grep ' app$'
++ awk '{ print $1, $(NF) }'
+ existing=446bbe11f780
+ '[' '!' -z 446bbe11f780 ']'
+ echo 'starting up existing container'
starting up existing container
+ set -x
+ /usr/bin/docker start app
app
+ exit 0
1 Like