-
Notifications
You must be signed in to change notification settings - Fork 1.8k
[docker_img_ctl.j2] make tmpfs mounts optional and add ability to run container by image id #6439
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
Changes from 4 commits
f908b82
155ef74
2bb997d
6082b82
48ff90a
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
| Original file line number | Diff line number | Diff line change |
|---|---|---|
|
|
@@ -31,7 +31,7 @@ function updateSyslogConf() | |
| { | ||
| # On multiNPU platforms, change the syslog target ip to docker0 ip to allow logs from containers | ||
| # running on the namespace to reach the rsyslog service running on the host | ||
| # Also update the container name | ||
| # Also update the container name | ||
| if [[ ($NUM_ASIC -gt 1) ]]; then | ||
| TARGET_IP=$(docker network inspect bridge --format={{ "'{{(index .IPAM.Config 0).Gateway}}'" }}) | ||
| CONTAINER_NAME="$DOCKERNAME" | ||
|
|
@@ -364,9 +364,11 @@ start() { | |
| -e SX_API_SOCKET_FILE=/var/run/sx_sdk/sx_api.sock \ | ||
| -v /dev/shm:/dev/shm:rw \ | ||
| {%- else %} | ||
| {%- if mount_default_tmpfs is defined and mount_default_tmpfs == "y" %} | ||
| --tmpfs /tmp \ | ||
| {%- endif %} | ||
| {%- endif %} | ||
| {%- endif %} | ||
| {%- if sonic_asic_platform == "broadcom" %} | ||
| {%- if docker_container_name == "syncd" %} | ||
| -v /var/run/docker-syncd$DEV:/var/run/sswsyncd \ | ||
|
|
@@ -388,13 +390,23 @@ start() { | |
| $REDIS_MNT \ | ||
| -v /usr/share/sonic/device/$PLATFORM:/usr/share/sonic/platform:ro \ | ||
| {%- if sonic_asic_platform != "mellanox" %} | ||
| {%- if mount_default_tmpfs is defined and mount_default_tmpfs == "y" %} | ||
| --tmpfs /tmp \ | ||
| {%- endif %} | ||
| {%- endif %} | ||
| {%- if mount_default_tmpfs is defined and mount_default_tmpfs == "y" %} | ||
| --tmpfs /var/tmp \ | ||
| {%- endif %} | ||
| --env "NAMESPACE_ID"="$DEV" \ | ||
| --env "NAMESPACE_PREFIX"="$NAMESPACE_PREFIX" \ | ||
| --env "NAMESPACE_COUNT"=$NUM_ASIC \ | ||
| --name=$DOCKERNAME {{docker_image_name}}:latest || { | ||
| --name=$DOCKERNAME \ | ||
| {%- if docker_image_name is defined %} | ||
| {{docker_image_name}}:latest \ | ||
| {%- else %} | ||
| {{docker_image_id}} \ | ||
|
Collaborator
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Why add docker_image_id? I don't find any clue in your PR description. #Closed
Collaborator
Author
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I updated title and PR description. |
||
| {%- endif %} | ||
| || { | ||
| echo "Failed to docker run" >&1 | ||
| exit 4 | ||
| } | ||
|
|
||
Uh oh!
There was an error while loading. Please reload this page.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
This
andcondition is verbose. Is it possible to simplify? #ClosedThere was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Indeed, please check the new way: