@@ -117,9 +117,6 @@ ENV PYTHONUNBUFFERED=1
117117ENV EDGE_BIND_HOST=0.0.0.0
118118ENV LOCALSTACK_HOSTNAME=localhost
119119
120- # Create the infra folder (will be populated later)
121- RUN mkdir -p /opt/code/localstack/localstack/infra
122-
123120RUN mkdir /root/.serverless; chmod -R 777 /root/.serverless
124121
125122# add trusted CA certificates to the cert store
@@ -178,9 +175,6 @@ RUN make freeze > requirements-runtime.txt
178175# remove localstack (added as a transitive dependency of localstack-ext)
179176RUN (virtualenv .venv && source .venv/bin/activate && pip3 uninstall -y localstack)
180177
181- # add the results of `make init` to the container. `make init` _needs_ to be executed before building this docker image.
182- ADD localstack/infra/ localstack/infra/
183-
184178
185179
186180# base-light: Stage which does not add additional dependencies (like elasticsearch)
@@ -251,16 +245,19 @@ RUN mkdir -p /.npm && \
251245 useradd -ms /bin/bash localstack && \
252246 ln -s `pwd` /tmp/localstack_install_dir
253247
248+ # Install the latest version of awslocal globally
249+ RUN pip3 install --upgrade awscli awscli-local requests
250+
254251# Add the code in the last step
252+ # Also adds the results of `make init` to the container.
253+ # `make init` _needs_ to be executed before building this docker image (since the execution needs docker itself).
255254ADD localstack/ localstack/
256255
257256# Download some more dependencies (make init needs the LocalStack code)
258- # FIXME the init python code should be independent and executed in the builder stage
257+ # FIXME the init python code should be independent (i.e. not depend on the localstack code), idempotent/reproducible,
258+ # modify only folders outside of the localstack package folder, and executed in the builder stage.
259259RUN make init
260260
261- # Install the latest version of awslocal globally
262- RUN pip3 install --upgrade awscli awscli-local requests
263-
264261# Install the latest version of localstack-ext and generate the plugin entrypoints
265262RUN (virtualenv .venv && source .venv/bin/activate && \
266263 pip3 install --upgrade localstack-ext localstack-plugin-loader)
0 commit comments