Skip to content

Is there a way to run an action step without networking? #24975

Answered by airtower-luna
kinnison asked this question in Actions
Discussion options

You must be logged in to vote
kinnison:

Is there a way to run in a ‘container’ which is just the host OS? I’d rather not complicate matters with another “platform” if I can avoid it.

On Linux you could achieve that with unshare --net ..., to run a command in a network namespace of its own without starting a full container that’d also be separated in other ways (like file system).

I do something similar here, to run web server tests in separate network and IPC namespaces:

github.com

airtower-luna/mod_gnutls/blob/461fd384dbc08afc2fd1bd1b66cb357bfa074312/test/netns_py.bash#L21-L22

  1. exec "${UNSHARE}" --net --ipc -r /bin/bash -c \
  2. "export MGS_NETNS_ACTIVE=1; ip link set up lo; exec ${UNSHARE} --user ${PYTHON} -u…

Replies: 9 comments

Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Answer selected
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
3 participants