diff options
author | Florian Didron <fdidron@users.noreply.github.com> | 2021-09-01 13:19:29 +0900 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-09-01 13:19:29 +0900 |
commit | fdd23b8e6e23eb848596eeaeb452433a236868dd (patch) | |
tree | 54e66f10ecce077a0241903b94b4d0eb201bd567 | |
parent | 10748911ea3677cb4c9ec36e0bf99a8412d794f3 (diff) | |
parent | 2577f07000a3acec3785e47e1c340ea714d843ae (diff) |
Merge pull request #124 from DarrienG/dg/docker-builds
Create pipeline for docker builds
-rw-r--r-- | Dockerfile | 34 | ||||
-rwxr-xr-x | build.linux.sh | 12 |
2 files changed, 46 insertions, 0 deletions
diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..2526f05 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,34 @@ +FROM centos:centos8 + +RUN dnf install -y dnf-plugins-core && \ + dnf config-manager --set-enabled powertools && \ + dnf install -y \ + gcc gtk3 gtk3-devel \ + libusb libusb-devel \ + nodejs npm pkg-config \ + webkit2gtk3 webkit2gtk3-devel wget && \ + mkdir project && \ + wget https://golang.org/dl/go1.16.6.linux-amd64.tar.gz -O go.tar.gz + +RUN tar -zxf go.tar.gz && \ + cp -r ./go /usr/local/bin + +ENV PATH=$PATH:/usr/local/bin/go/bin + +WORKDIR project +COPY /*.go ./ +COPY /go.mod ./go.mod +COPY /go.sum ./go.sum +COPY /frontend ./frontend +COPY /project.json ./project.json +COPY /wally ./wally + +WORKDIR frontend + +RUN npm install && \ + npm run build + +WORKDIR .. + +RUN go build -o wally-bin +ENTRYPOINT ["sleep", "infinity"] diff --git a/build.linux.sh b/build.linux.sh new file mode 100755 index 0000000..dfc3945 --- /dev/null +++ b/build.linux.sh @@ -0,0 +1,12 @@ +#!/usr/bin/env bash + +set -eou pipefail + +CONTAINER_NAME="$(uuidgen)" + +docker build -t wally . +docker run --rm -d --name "$CONTAINER_NAME" wally + +docker cp $CONTAINER_NAME:/project/wally-bin ./dist/linux64/wally + +docker kill --signal SIGKILL "$CONTAINER_NAME" |