Skip to content

Commit 02b03d9

Browse files
committed
docker: Generify container
Remove all hardcoded paths that start with /firecracker from the docker container such that it can be used outside of the firecracker repository. Signed-off-by: Patrick Roy <[email protected]>
1 parent 3e6a865 commit 02b03d9

File tree

2 files changed

+4
-8
lines changed

2 files changed

+4
-8
lines changed

tools/devctr/Dockerfile

Lines changed: 1 addition & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -6,10 +6,6 @@ FROM public.ecr.aws/lts/ubuntu:22.04
66

77
ARG RUST_TOOLCHAIN="1.79.0"
88
ARG TMP_BUILD_DIR=/tmp/build
9-
ARG FIRECRACKER_SRC_DIR="/firecracker"
10-
ARG FIRECRACKER_BUILD_DIR="$FIRECRACKER_SRC_DIR/build"
11-
ARG CARGO_REGISTRY_DIR="$FIRECRACKER_BUILD_DIR/cargo_registry"
12-
ARG CARGO_GIT_REGISTRY_DIR="$FIRECRACKER_BUILD_DIR/cargo_git_registry"
139
ARG DEBIAN_FRONTEND=noninteractive
1410
ARG ARCH
1511

@@ -132,9 +128,7 @@ RUN curl https://sh.rustup.rs -sSf | sh -s -- -y --default-toolchain "$RUST_TOOL
132128
&& cd && rm -r /tmp/crosvm \
133129
\
134130
&& rm -rf "$CARGO_HOME/registry" \
135-
&& ln -s "$CARGO_REGISTRY_DIR" "$CARGO_HOME/registry" \
136-
&& rm -rf "$CARGO_HOME/git" \
137-
&& ln -s "$CARGO_GIT_REGISTRY_DIR" "$CARGO_HOME/git"
131+
&& rm -rf "$CARGO_HOME/git"
138132

139133
# help musl-gcc find linux headers
140134
RUN cd /usr/include/$ARCH-linux-musl \
@@ -162,5 +156,4 @@ RUN cd /usr/local/bin \
162156

163157
ADD tools/devctr/ctr_gitconfig /root/.gitconfig
164158

165-
WORKDIR "$FIRECRACKER_SRC_DIR"
166159
ENTRYPOINT ["/usr/bin/tini", "--"]

tools/devtool

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -228,6 +228,7 @@ cmd_fix_perms() {
228228
# Yes, running Docker to get elevated privileges, just to chown some files
229229
# is a dirty hack.
230230
run_devctr \
231+
--workdir "$CTR_FC_ROOT_DIR" \
231232
-- \
232233
chown -R "$(id -u):$(id -g)" "$CTR_FC_BUILD_DIR"
233234
}
@@ -305,6 +306,8 @@ run_devctr() {
305306
--rm \
306307
--volume /dev:/dev \
307308
--volume "$FC_ROOT_DIR:$CTR_FC_ROOT_DIR:z" \
309+
--volume "$FC_ROOT_DIR/build/cargo_registry:/usr/local/rust/registry:z" \
310+
--volume "$FC_ROOT_DIR/build/cargo_git_registry:/usr/local/rust/git:z" \
308311
--tmpfs /srv:exec,dev,size=32G \
309312
-v /boot:/boot \
310313
--env PYTHONDONTWRITEBYTECODE=1 \

0 commit comments

Comments
 (0)