diff --git a/.github/workflows/docker-image.yml b/.github/workflows/docker-image.yml index 7a5e2a0..dae92e0 100644 --- a/.github/workflows/docker-image.yml +++ b/.github/workflows/docker-image.yml @@ -18,11 +18,11 @@ jobs: run: | if [ "$GITHUB_REF_TYPE" = "tag" ] then - echo IMAGE_TYPE=beta + echo IMAGE_TYPE="" echo IMAGE_TAG=$GITHUB_REF_NAME else - echo IMAGE_TYPE=dev - echo IMAGE_TAG= + echo IMAGE_TYPE=-dev + echo IMAGE_TAG=$(date -u +%s) fi >> $GITHUB_ENV - name: Login to GitHub Container Registry uses: docker/login-action@v3 @@ -33,4 +33,10 @@ jobs: - uses: actions/checkout@v4 - name: Build the Docker image - run: cd beta && ./docker-build.sh $IMAGE_TYPE $IMAGE_TAG + # run: ./docker-build.sh $IMAGE_TYPE $IMAGE_TAG + run: | + TAG=ghcr.io/iti/pcesapps$IMAGE_TYPE:$IMAGE_TAG + TAG2=ghcr.io/iti/pcesapps$IMAGE_TYPE:latest + docker build --no-cache -t $TAG -t $TAG2 . + docker push $TAG + docker push $TAG2 diff --git a/Dockerfile b/Dockerfile new file mode 100644 index 0000000..0d71830 --- /dev/null +++ b/Dockerfile @@ -0,0 +1,21 @@ +# Usage: +# +# docker build -t pcesapps-dev:latest -t pcesapps:latest . +# docker run -it --rm -v ~/pcesapps/extern:/tmp/extern ghcr.io/iti/pcesapps-dev +# docker run -it --rm -v ~/pcesapps/extern:/tmp/extern ghcr.io/iti/pcesapps +# +FROM golang:1.23-bookworm + +# Add whatever Debian packages you want here. +RUN apt-get -y update && \ + apt-get install --no-install-recommends -y \ + vim-nox && \ + rm -rf /var/lib/apt/lists/* + +# Build the pcesapps app +WORKDIR /pcesapps +COPY . . +RUN cd embedded/sim-dir && go mod tidy && go build -o /bin/sim sim.go exp.go + +# remember to use "-v" to map in /tmp/extern +WORKDIR /tmp/extern