Skip to content

Commit a09897c

Browse files
committed
docker to push only small files
1 parent b374ea0 commit a09897c

File tree

3 files changed

+35
-29
lines changed

3 files changed

+35
-29
lines changed

.dockerignore

Lines changed: 9 additions & 29 deletions
Original file line numberDiff line numberDiff line change
@@ -1,29 +1,9 @@
1-
sdxl-cache/
2-
refiner-cache/
3-
safety-cache/
4-
trained-model/
5-
*.png
6-
cache/
7-
checkpoint/
8-
training_out/
9-
dreambooth/
10-
lora/
11-
ttemp/
12-
.git/
13-
cog_class_data/
14-
dataset/
15-
training_data/
16-
temp/
17-
temp_in/
18-
cog_instance_data/
19-
example_datasets/
20-
trained_model.tar
21-
zeke_data.tar
22-
data.tar
23-
zeke.zip
24-
sketch-mountains-input.jpeg
25-
training_out*
26-
weights
27-
inference_*
28-
trained-model
29-
*.zip
1+
./safety-cache/pytorch_model.bin
2+
./sdxl-cache/text_encoder_2/model.safetensors
3+
./sdxl-cache/text_encoder/model.safetensors
4+
./sdxl-cache/unet/diffusion_pytorch_model.safetensors
5+
./sdxl-cache/vae/diffusion_pytorch_model.safetensors
6+
./refiner-cache/text_encoder_2/model.safetensors
7+
./refiner-cache/unet/diffusion_pytorch_model.safetensors
8+
./refiner-cache/vae/diffusion_pytorch_model.safetensors
9+
./.git/objects/pack/pack-64d5a3b3da6d169e942b61379f9b200779655a5b.pack

Dockerfile

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,4 @@
1+
ARG BASE_IMAGE
2+
FROM ${BASE_IMAGE}
3+
4+
COPY . /src

build.sh

Lines changed: 22 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,22 @@
1+
#!/bin/bash
2+
3+
set -o errexit
4+
set -o xtrace
5+
6+
echo "Build the base + weights"
7+
8+
BASE_IMAGE="r8.im/alexgenovese/sdxl"
9+
10+
# echo "ignore all the small files, copy big files"
11+
# find . -type f -size -10M > .dockerignore
12+
# docker build --build-arg BASE_IMAGE=$BASE_IMAGE -t base .
13+
14+
# BASE_ID=$(docker inspect $(BASE_IMAGE) --format='{{index .Id}}')
15+
16+
echo "ignore all the big files, copy copy files"
17+
find . -type f -size +10M > .dockerignore
18+
docker build --build-arg BASE_IMAGE=$BASE_IMAGE -t final .
19+
FINAL_ID=$(docker inspect final:latest --format='{{index .Id}}')
20+
21+
echo "Final image: $FINAL_ID"
22+
cog push

0 commit comments

Comments
 (0)