tk3369 / aws-lambda-container-julia

An example of running Julia program as AWS Lambda using container image
MIT License
43 stars 19 forks source link

Error response from daemon: driver failed programming external connectivity on endpoint #3

Open davibarreira opened 2 years ago

davibarreira commented 2 years ago

Hey, Tom. Thanks for the awesome tutorial! I've found this package from the YouTube video. I cloned the repo and I tried running the

sudo docker build -t julia-lambda:latest . && sudo docker run -it --rm -p 9000:8080 julia-lambda:latest

The building part seems to work, but when I try to run the run part I get the following error:

docker: Error response from daemon: driver failed programming external connectivity on endpoint silly_goldstine (dd5a05f3ad78ec34509a38283a046e8011c9e852e24171a98f8437e3f792142c):  (iptables failed: iptables --wait -t nat -A DOCKER -p tcp -d 0/0 --dport 9000 -j DNAT --to-destination 172.17.0.2:8000 ! -i docker0: iptables v1.8.7 (nf_tables): unknown option "--dport"
Try `iptables -h' or 'iptables --help' for more information.
 (exit status 2)).

Any idea on what might be going on?

tk3369 commented 1 year ago

You shouldn't need to use sudo. Try this instead:

docker build -t julia-lambda:latest . && docker run -it --rm -p 9000:8080 julia-lambda:latest

This is what I get:

$ DOCKER_BUILDKIT=1 docker build -t julia-lambda-2:latest . && docker run -it --rm -p 9000:8080 julia-lambda-2:latest 
[+] Building 4.0s (16/16) FINISHED                                                                                         
 => [internal] load build definition from Dockerfile                                                                  0.1s
 => => transferring dockerfile: 38B                                                                                   0.0s
 => [internal] load .dockerignore                                                                                     0.2s
 => => transferring context: 34B                                                                                      0.0s
 => [internal] load metadata for public.ecr.aws/lambda/provided:al2                                                   0.0s
 => [ 1/11] FROM public.ecr.aws/lambda/provided:al2                                                                   0.0s
 => [internal] load build context                                                                                     0.1s
 => => transferring context: 3.55kB                                                                                   0.0s
 => CACHED [ 2/11] WORKDIR /usr/local                                                                                 0.0s
 => CACHED [ 3/11] RUN yum install -y tar gzip  && curl -LO https://julialang-s3.julialang.org/bin/linux/x64/1.8/jul  0.0s
 => CACHED [ 4/11] WORKDIR /var/task                                                                                  0.0s
 => CACHED [ 5/11] COPY Manifest.toml .                                                                               0.0s
 => CACHED [ 6/11] COPY Project.toml .                                                                                0.0s
 => CACHED [ 7/11] RUN /usr/local/julia/bin/julia --project=. -e "using Pkg; Pkg.instantiate(); Pkg.API.precompile()  0.0s
 => [ 8/11] COPY . .                                                                                                  0.2s
 => [ 9/11] WORKDIR /var/runtime                                                                                      0.1s
 => [10/11] COPY --chmod=0755 bootstrap .                                                                             0.2s
 => [11/11] WORKDIR /opt/extensions                                                                                   0.1s
 => exporting to image                                                                                                2.8s
 => => exporting layers                                                                                               2.8s
 => => writing image sha256:1a69b80c07adc692ef20b93f61d1691ae01da963e4a39b71e2b569b5916f5e3f                          0.0s
 => => naming to docker.io/library/julia-lambda-2:latest                                                              0.0s
INFO[0000] exec '/var/runtime/bootstrap' (cwd=/opt/extensions, handler=) 
tk3369 commented 1 year ago

Sorry about taking so long to respond. Feel free to ping me on Slack or Discord. I lurk around those places more often than GitHub.