-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Build docker image with backup tools
- Loading branch information
Showing
3 changed files
with
63 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,32 @@ | ||
name: CI | ||
|
||
"on": | ||
merge_group: {} | ||
pull_request: {} | ||
push: | ||
tags: | ||
- "*" | ||
|
||
jobs: | ||
|
||
build: | ||
runs-on: ubuntu-latest | ||
|
||
# Only do Docker builds of tagged releases and pull requests from ticket | ||
# branches. | ||
if: > | ||
startsWith(github.ref, 'refs/tags/') | ||
|| startsWith(github.head_ref, 'tickets/') | ||
steps: | ||
- uses: actions/checkout@v4 | ||
with: | ||
fetch-depth: 0 | ||
|
||
- uses: lsst-sqre/build-and-push-to-ghcr@v1 | ||
id: build | ||
with: | ||
image: ${{ github.repository }} | ||
github_token: ${{ secrets.GITHUB_TOKEN }} | ||
|
||
- run: echo Pushed ghcr.io/${{ github.repository }}:${{ steps.build.outputs.tag }} |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,30 @@ | ||
# Start from the InfluxDB Enterprise Meta image | ||
# This provides the InfluxDB Enterprise influxd-ctl command | ||
FROM influxdb:1.11.8-meta | ||
|
||
# Install pipx and use it to install gsutil which is required for the backup script | ||
# to upload the backup files to Google Cloud Storage | ||
RUN apt-get update && \ | ||
apt-get install -y python3 python3-pip pipx && \ | ||
pipx install gsutil && \ | ||
apt-get clean && \ | ||
rm -rf /var/lib/apt/lists/* | ||
|
||
# Add pipx bin directory to PATH | ||
ENV PATH="/root/.local/bin:$PATH" | ||
|
||
# Verify gsutil installation | ||
RUN gsutil --version | ||
|
||
# Add the backup script | ||
COPY backup/backup.sh /usr/local/bin/backup.sh | ||
RUN chmod +x /usr/local/bin/backup.sh | ||
|
||
# Create a new user to run the backup script | ||
RUN useradd --create-home sasquatch | ||
|
||
# Switch to the non-root user. | ||
USER sasquatch | ||
|
||
# Set the default command for the container | ||
CMD ["/usr/local/bin/backup.sh"] |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
echo "backup" |