Skip to content

Commit

Permalink
Update: image script
Browse files Browse the repository at this point in the history
  • Loading branch information
i0gan committed Aug 12, 2024
1 parent 6a86bb4 commit a6c5047
Show file tree
Hide file tree
Showing 5 changed files with 56 additions and 14 deletions.
17 changes: 13 additions & 4 deletions docker/build_image.sh
Original file line number Diff line number Diff line change
Expand Up @@ -3,17 +3,22 @@
cd $(dirname $0)
source ../tools/common.sh

build_type='docker'
version=$1
if [[ $version == "" ]];then
version="1.2"
fi

dockerfile=./docker/src_dep
is_build_third_party=0
is_build_sqkctl=0
src_image_tag=pwnsky/squick_src:1.2
bin_image_tag=pwnsky/squick:1.2
src_image_tag=pwnsky/squick_src:$version
bin_image_tag=pwnsky/squick:$version
build_container=squick_src_build

cd $project_path

echo "Build src image"
docker build . -t $src_image_tag -f ./docker/src
docker build . -t $src_image_tag -f $dockerfile
check_err

echo "Export binary files"
Expand All @@ -33,5 +38,9 @@ echo "Build release image"
docker build . -t $bin_image_tag -f ./docker/release
check_err

echo "Exporting the image"
docker save -o ../cache/squick_$version.tar pwnsky/squick:$version
check_err

echo "Build image ok"
print_ok
13 changes: 3 additions & 10 deletions docker/release
Original file line number Diff line number Diff line change
@@ -1,18 +1,11 @@
# cd {squick_project}
# docker build . -t i0gan/squick_src:1.1 -f ./docker/src
# docker run -d --name squick_src i0gan/squick_src:1.1
# rm -rf ./cache/docker_deploy
# docker cp squick_src:/squick/deploy ./cache/docker_deploy

# docker build . -t i0gan/squick:1.1 -f ./docker/release
# docker run -it --name squick i0gan/squick:1.1

FROM ubuntu:22.04

# Set env
ARG DEBIAN_FRONTEND=noninteractive
RUN apt update && apt install -y dos2unix vim net-tools

# copy from docker builded files
COPY ./cache/docker_deploy /squick
WORKDIR /squick
RUN chmod +x /squick/script/*.sh
CMD bash /squick/script/squick.sh
CMD bash /squick/script/squick.sh
18 changes: 18 additions & 0 deletions docker/release_mini
Original file line number Diff line number Diff line change
@@ -0,0 +1,18 @@
# cd {squick_project}
# docker build . -t i0gan/squick_src:1.1 -f ./docker/src
# docker run -d --name squick_src i0gan/squick_src:1.1
# rm -rf ./cache/docker_deploy
# docker cp squick_src:/squick/deploy ./cache/docker_deploy

# docker build . -t i0gan/squick:1.1 -f ./docker/release
# docker run -it --name squick i0gan/squick:1.1

FROM ubuntu:22.04
# Set env
ARG DEBIAN_FRONTEND=noninteractive

# copy from docker builded files
COPY ./cache/docker_deploy /squick
WORKDIR /squick
RUN chmod +x /squick/script/*.sh
CMD bash /squick/script/squick.sh
15 changes: 15 additions & 0 deletions docker/src_dep
Original file line number Diff line number Diff line change
@@ -0,0 +1,15 @@
FROM pwnsky/squick_src:1.1

COPY . /squick_dep

RUN rm -rf /squick_dep/third_party && mv /squick/third_party /squick_dep && rm -rf /squick && mv /squick_dep /squick

WORKDIR /squick
RUN cd tools && chmod +x *.sh && dos2unix *.sh
RUN cd script && chmod +x *.sh && dos2unix *.sh

RUN bash ./tools/clean_squick.sh
RUN bash ./tools/build_sqkctl.sh
RUN bash ./tools/build_squick.sh
RUN bash ./tools/generate_deploy.sh
CMD bash /squick/script/squick.sh
7 changes: 7 additions & 0 deletions tools/generate_k8s_deploy.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,7 @@
#! /bin/bash

# build image
bash ../docker/build_image.sh



0 comments on commit a6c5047

Please sign in to comment.