diff --git a/Dockerfile b/Dockerfile index 7e6e0c7..f094a49 100644 --- a/Dockerfile +++ b/Dockerfile @@ -1,4 +1,4 @@ -FROM alpine:latest +FROM alpine:3.16 # Install the packages we need. Avahi will be included RUN echo -e "http://nl.alpinelinux.org/alpine/edge/testing\nhttp://dl-cdn.alpinelinux.org/alpine/edge/main" >> /etc/apk/repositories &&\ diff --git a/buildspec-manifest.yml b/buildspec-manifest.yml index 92b4457..8077aaa 100644 --- a/buildspec-manifest.yml +++ b/buildspec-manifest.yml @@ -17,15 +17,19 @@ phases: build: commands: - echo Build started on `date` - - echo Building the Docker manifest... + - echo Building the Docker manifest... + - VERSION=$(cat version.txt) - export DOCKER_CLI_EXPERIMENTAL=enabled - - docker manifest create $DOCKERHUB_USERNAME/$IMAGE_REPO_NAME $DOCKERHUB_USERNAME/$IMAGE_REPO_NAME:latest-arm64 $DOCKERHUB_USERNAME/$IMAGE_REPO_NAME:latest-amd64 - - docker manifest annotate --arch arm64 $DOCKERHUB_USERNAME/$IMAGE_REPO_NAME $DOCKERHUB_USERNAME/$IMAGE_REPO_NAME:latest-arm64 - - docker manifest annotate --arch amd64 $DOCKERHUB_USERNAME/$IMAGE_REPO_NAME $DOCKERHUB_USERNAME/$IMAGE_REPO_NAME:latest-amd64 + - docker manifest create $DOCKERHUB_USERNAME/$IMAGE_REPO_NAME:$VERSION $DOCKERHUB_USERNAME/$IMAGE_REPO_NAME:$VERSION-arm64 $DOCKERHUB_USERNAME/$IMAGE_REPO_NAME:$VERSION-amd64 + - docker manifest annotate --arch arm64 $DOCKERHUB_USERNAME/$IMAGE_REPO_NAME:$VERSION $DOCKERHUB_USERNAME/$IMAGE_REPO_NAME:$VERSION-arm64 + - docker manifest annotate --arch amd64 $DOCKERHUB_USERNAME/$IMAGE_REPO_NAME:$VERSION $DOCKERHUB_USERNAME/$IMAGE_REPO_NAME:$VERSION-amd64 + - docker manifest create $DOCKERHUB_USERNAME/$IMAGE_REPO_NAME:latest $DOCKERHUB_USERNAME/$IMAGE_REPO_NAME:$VERSION-arm64 $DOCKERHUB_USERNAME/$IMAGE_REPO_NAME:$VERSION-amd64 + - docker manifest annotate --arch arm64 $DOCKERHUB_USERNAME/$IMAGE_REPO_NAME:$VERSION $DOCKERHUB_USERNAME/$IMAGE_REPO_NAME:$VERSION-arm64 + - docker manifest annotate --arch amd64 $DOCKERHUB_USERNAME/$IMAGE_REPO_NAME:$VERSION $DOCKERHUB_USERNAME/$IMAGE_REPO_NAME:$VERSION-amd64 post_build: commands: - echo Build completed on `date` - echo Pushing the Docker image... - - docker manifest push $DOCKERHUB_USERNAME/$IMAGE_REPO_NAME - - docker manifest inspect $DOCKERHUB_USERNAME/$IMAGE_REPO_NAME + - docker manifest push $DOCKERHUB_USERNAME/$IMAGE_REPO_NAME:$VERSION + - docker manifest push $DOCKERHUB_USERNAME/$IMAGE_REPO_NAME:latest diff --git a/buildspec.yml b/buildspec.yml index 8f618e4..55d63cf 100644 --- a/buildspec.yml +++ b/buildspec.yml @@ -13,17 +13,14 @@ phases: commands: - echo Logging in to DOCKER... - docker login --username $DOCKERHUB_USERNAME --password $DOCKERHUB_PASS - #- $(aws ecr get-login --no-include-email --region $AWS_DEFAULT_REGION) build: commands: - echo Build started on `date` - - echo Building the Docker image... - - docker build -t $DOCKERHUB_USERNAME/$IMAGE_REPO_NAME:$IMAGE_TAG . - - docker tag $DOCKERHUB_USERNAME/$IMAGE_REPO_NAME:$IMAGE_TAG $DOCKERHUB_USERNAME/$IMAGE_REPO_NAME:$IMAGE_TAG - #- docker tag $IMAGE_REPO_NAME:$IMAGE_TAG $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com/$IMAGE_REPO_NAME:$IMAGE_TAG + - echo Building the Docker image... + - VERSION=$(cat version.txt) + - docker build -t $DOCKERHUB_USERNAME/$IMAGE_REPO_NAME:$VERSION-$ARCH -t $DOCKERHUB_USERNAME/$IMAGE_REPO_NAME:$IMAGE_TAG-$ARCH . post_build: commands: - echo Build completed on `date` - echo Pushing the Docker image... - - docker push $DOCKERHUB_USERNAME/$IMAGE_REPO_NAME:$IMAGE_TAG - #- docker push $AWS_ACCOUNT_ID.dkr.ecr.$AWS_DEFAULT_REGION.amazonaws.com/$IMAGE_REPO_NAME:$IMAGE_TAG + - docker push $DOCKERHUB_USERNAME/$IMAGE_REPO_NAME --all-tags diff --git a/root/root/run_cups.sh b/root/root/run_cups.sh index dbda4de..61542a9 100644 --- a/root/root/run_cups.sh +++ b/root/root/run_cups.sh @@ -30,6 +30,10 @@ if [ `ls -l /config/printers.conf 2>/dev/null | wc -l` -eq 0 ]; then fi cp /config/printers.conf /etc/cups/printers.conf +if [ `ls -l /config/cupsd.conf 2>/dev/null | wc -l` -eq 0 ]; then + cp /etc/cups/cupsd.conf /config/cupsd.conf +fi + /usr/sbin/avahi-daemon --daemonize /root/printer-update.sh & -exec /usr/sbin/cupsd -f +exec /usr/sbin/cupsd -f -c /config/cupsd.conf diff --git a/version.txt b/version.txt new file mode 100644 index 0000000..9084fa2 --- /dev/null +++ b/version.txt @@ -0,0 +1 @@ +1.1.0