Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docker: added jdxcode/rtx image #1117

Merged
merged 4 commits into from
Dec 8, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
25 changes: 25 additions & 0 deletions .github/workflows/docker.yml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,7 @@ jobs:
- deb
- github-actions
- rpm
- rtx
runs-on: ubuntu-latest
permissions:
contents: read
Expand Down Expand Up @@ -61,3 +62,27 @@ jobs:
run: cargo nextest run --all-features
env:
RUST_BACKTRACE: "1"
dockerhub:
runs-on: ubuntu-latest
steps:
- uses: actions/checkout@v4
- name: Set up Docker Buildx
uses: docker/setup-buildx-action@v1
- name: Log in to Docker Hub
uses: docker/login-action@v3
with:
username: ${{ secrets.DOCKER_USERNAME }}
password: ${{ secrets.DOCKER_PASSWORD }}
- name: Extract metadata (tags, labels) for Docker
id: meta
uses: docker/metadata-action@v5
with:
images: jdxcode/rtx
- name: Build and push Docker image
uses: docker/build-push-action@v5
with:
file: ./Dockerfile
platforms: linux/amd64,linux/arm64
push: true
tags: jdxcode/rtx:latest
labels: ${{ steps.meta.outputs.labels }}
4 changes: 2 additions & 2 deletions .github/workflows/release.yml
Original file line number Diff line number Diff line change
Expand Up @@ -127,7 +127,7 @@ jobs:
runs-on: ubuntu-22.04
needs: [build-tarball]
timeout-minutes: 10
container: jdxcode/rtx:rpm
container: ghcr.io/jdxcode/rtx:rpm
steps:
- uses: actions/checkout@v4
- uses: crazy-max/ghaction-import-gpg@v6
Expand All @@ -149,7 +149,7 @@ jobs:
if-no-files-found: error
deb:
runs-on: ubuntu-22.04
container: jdxcode/rtx:deb
container: ghcr.io/jdxcode/rtx:deb
timeout-minutes: 10
needs: [build-tarball]
steps:
Expand Down
1 change: 1 addition & 0 deletions Dockerfile
8 changes: 8 additions & 0 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -441,6 +441,14 @@ You can also import the package directly using
`rtx-flake.packages.${system}.rtx`. It supports all default Nix
systems.

</details>
<details>
<summary>Docker</summary>

```
docker run jdxcode/rtx x node@20 -- node -v
```

</details>

### Register shell hook
Expand Down
24 changes: 24 additions & 0 deletions packaging/rtx/Dockerfile
Original file line number Diff line number Diff line change
@@ -0,0 +1,24 @@
FROM ubuntu:22.04
LABEL maintainer="jdx"

ENV RTX_DATA_DIR="/rtx"
ENV RTX_CONFIG_DIR="/rtx"
ENV RTX_CACHE_DIR="/rtx/cache"
ENV PATH="/rtx/shims:/rtx/bin:$PATH"

ENV RTX_INSTALL_PATH="/rtx/bin/rtx"

RUN apt-get update && apt-get install -y \
build-essential \
curl \
bash \
git \
wget \
&& apt-get clean && rm -rf /var/lib/apt/lists/* \
# TODO: build from this source
&& curl -fsSL https://rtx.pub/install.sh | sh \
&& rtx --version

WORKDIR /rtx
ENTRYPOINT ["rtx"]
CMD ["--help"]
3 changes: 2 additions & 1 deletion packaging/standalone/install.envsubst
Original file line number Diff line number Diff line change
Expand Up @@ -115,7 +115,8 @@ install_rtx() {
os="$(get_os)"
arch="$(get_arch)"
xdg_data_home="${XDG_DATA_HOME:-$HOME/.local/share}"
install_path="${RTX_INSTALL_PATH:-$xdg_data_home/rtx/bin/rtx}"
rtx_data_dir="${RTX_DATA_DIR:-$xdg_data_home/rtx}"
install_path="${RTX_INSTALL_PATH:-${rtx_data_dir:}/bin/rtx}"
install_dir="$(dirname "$install_path")"
tarball_url="https://github.com/jdx/rtx/releases/download/${version}/rtx-${version}-${os}-${arch}.tar.gz"

Expand Down
Loading