-
Notifications
You must be signed in to change notification settings - Fork 1.6k
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
enabling using another container's network stack on build process #5088
enabling using another container's network stack on build process #5088
Conversation
Codecov Report
@@ Coverage Diff @@
## master #5088 +/- ##
==========================================
+ Coverage 72.19% 72.21% +0.01%
==========================================
Files 380 380
Lines 13303 13391 +88
==========================================
+ Hits 9604 9670 +66
- Misses 3006 3022 +16
- Partials 693 699 +6
Continue to review full report at Codecov.
|
b2be10f
to
70f9b13
Compare
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.
LGTM except 1 question
Building docker images in a Jenkins-like environment running on a AWS EKS cluster secured with `kube2iam` requires the running pod to include an annotation. In our particular case, we share the docker daemon from the node with the running pod by mounting the socket as a volume. When `skaffold` builds a new image within this pod, it creates containers at node level due to the shared socket. Therefore, to have a brand new container handled by `kube2iam`, this container should reuse the pod's network stack –ergo the "pause" container's stack–. Enabling the use of `container:<name|id>` network mode from `docker run` command. It allows a build process to reuse another container's stack. > Described in [here](https://docs.docker.com/engine/reference/run/#network-settings)
8980118
to
0474c1e
Compare
According to the `docker` CLI, when running a container with a wrong name, the following output is shown: ``` > docker run -it --name '$$' alpine docker: Error response from daemon: Invalid container name ($$), only [a-zA-Z0-9][a-zA-Z0-9_.-] are allowed. ``` Concatenating `container:` to the expected regular expression `[a-zA-Z0-9][a-zA-Z0-9_.-]` helps us rejecting wrong values.
0474c1e
to
df3e6b3
Compare
@tejal29 I just added a validation process using the runtime context. The idea is as follows **User facing changes ** When a user tries to use a Assuming there's no running container in minikube
when invoking skaffold we get the error
After starting a container named 'alpine' in minikube
Then we can run our build with no problems
Let's try to, by using the local docker daemon. After doing unset on the current-context
Last but not least, testing the
|
3a8ec00
to
f7078b3
Compare
39f12ba
to
6081358
Compare
6081358
to
27e3614
Compare
better testing allows to unify methods
d3ce994
to
cf88666
Compare
@tejal29 |
53d1918
to
c38af5c
Compare
c38af5c
to
5600d38
Compare
Yesssss!!! |
Fixes: #5087
Description
Modifying docker network mode validation to accept
container:<name|id>
network identifier, allowing to reuse the network stack from an existing container (defined byname
orid
).User facing changes (remove if N/A)
Before
For a given
skaffold.yaml
:the output was (described in the issue):
After
When there is NO running container with such name
Checking that no alpine container runs in minikube:
Running
skaffold
with the previousyaml
file:When there is a running container with such name
Starting an
alpine
container within minikube:when running skaffold: