Dockerfile: use bash

This commit is contained in:
Shuanglei Tao
2019-12-08 22:31:45 +08:00
parent 1b2c45040a
commit 607bf08494
4 changed files with 18 additions and 19 deletions

View File

@@ -17,11 +17,11 @@ jobs:
matrix:
lws-version: [3.2.0, 3.1.0, 2.4.2]
steps:
- name: install apt packages
- name: Install packages
run: |
sudo apt-get update
sudo apt-get install build-essential cmake libjson-c-dev libssl-dev libuv1-dev
- name: compile libwebsockets-${{ matrix.lws-version }} from source
- name: Install libwebsockets-${{ matrix.lws-version }}
env:
LWS_VERSION: ${{ matrix.lws-version }}
run: |
@@ -31,7 +31,7 @@ jobs:
cmake -DLWS_WITH_LIBUV=ON -DLWS_UNIX_SOCK=ON -DLWS_IPV6=ON -DLWS_WITHOUT_TESTAPPS=ON -DCMAKE_BUILD_TYPE=RELEASE .
make && sudo make install && sudo ldconfig
- uses: actions/checkout@v1
- name: build ttyd
- name: Build ttyd
run: |
cmake -DCMAKE_BUILD_TYPE=RELEASE .
make && sudo make install
@@ -43,7 +43,7 @@ jobs:
arch: [i386, x86_64, arm, armhf, mips, mipsel]
steps:
- uses: actions/checkout@v1
- name: cross build (${{ matrix.arch }})
- name: Cross build (${{ matrix.arch }})
env:
ARCH: ${{ matrix.arch }}
run: docker run --rm -v $(pwd):/ttyd -w /ttyd tsl0922/musl-cross ./scripts/cross-build.sh $ARCH

View File

@@ -16,7 +16,7 @@ jobs:
- uses: actions/setup-node@v1
with:
node-version: '12.x'
- name: yarn install, check and build
- name: Run yarn install, check and build
run: |
cd html
yarn install

View File

@@ -1,15 +1,14 @@
FROM tsl0922/musl-cross
RUN git clone --depth=1 https://github.com/tsl0922/ttyd.git /tmp/ttyd \
&& cd /tmp/ttyd && ./scripts/cross-build.sh x86_64
RUN git clone --depth=1 https://github.com/tsl0922/ttyd.git /ttyd \
&& cd /ttyd && ./scripts/cross-build.sh x86_64
FROM ubuntu:18.04
COPY --from=0 /tmp/ttyd/build/ttyd /usr/local/bin/ttyd
COPY --from=0 /ttyd/build/ttyd /usr/bin/ttyd
ENV TINI_VERSION v0.18.0
ADD https://github.com/krallin/tini/releases/download/${TINI_VERSION}/tini /tini
RUN chmod +x /tini
ADD https://github.com/krallin/tini/releases/download/v0.18.0/tini /sbin/tini
RUN chmod +x /sbin/tini
EXPOSE 7681
ENTRYPOINT ["/tini", "--"]
CMD ["ttyd", "sh"]
ENTRYPOINT ["/sbin/tini", "--"]
CMD ["ttyd", "bash"]

View File

@@ -1,12 +1,12 @@
FROM tsl0922/musl-cross
RUN git clone --depth=1 https://github.com/tsl0922/ttyd.git /tmp/ttyd \
&& cd /tmp/ttyd && ./scripts/cross-build.sh x86_64
RUN git clone --depth=1 https://github.com/tsl0922/ttyd.git /ttyd \
&& cd /ttyd && ./scripts/cross-build.sh x86_64
FROM alpine:3.9
COPY --from=0 /tmp/ttyd/build/ttyd /usr/local/bin/ttyd
RUN apk add --no-cache tini
FROM alpine:3.10
COPY --from=0 /ttyd/build/ttyd /usr/bin/ttyd
RUN apk add --no-cache bash tini
EXPOSE 7681
ENTRYPOINT ["/sbin/tini", "--"]
CMD ["ttyd", "sh"]
CMD ["ttyd", "bash"]