Skip to content

Commit

Permalink
If applied, this commit will add update libs references.
Browse files Browse the repository at this point in the history
  • Loading branch information
UellingtonDamasceno committed Feb 8, 2024
1 parent 153bcf3 commit d2e155f
Show file tree
Hide file tree
Showing 3 changed files with 33 additions and 12 deletions.
39 changes: 28 additions & 11 deletions Dockerfile
Original file line number Diff line number Diff line change
@@ -1,16 +1,33 @@
FROM vegardit/graalvm-maven:latest-java17 AS build
FROM ubuntu:bionic as builder
LABEL maintainder="UDamasceno <udamasceno@ecomp.uefs.br>"

WORKDIR /opt
COPY . .
RUN mvn -Pnative -DskipTests package && ls

FROM ubuntu:23.04

RUN apt-get update -y && apt-get upgrade -y && apt-get autoremove -y\
&& apt-get install net-tools -y\
&& apt-get install iproute2 -y\
&& apt-get install iputils-ping -y\
&& apt-get autoremove -y\
&& apt-get install wget -y\
&& wget https://github.com/UellingtonDamasceno/virtual-fot-device/archive/refs/tags/latest.zip\
&& apt-get install unzip -y\
&& unzip latest.zip\
&& rm latest.zip\
&& mv virtual-fot-device-latest vfd\
&& cd vfd\
&& apt-get install openjdk-11-jdk maven -y\
&& mvn clean install\
&& apt-get purge maven -y\
&& apt-get autoremove -y\
&& apt-get clean && rm -rf /var/lib/apt/lists/* /tmp/* /var/tmp/*

FROM adoptopenjdk/openjdk11:jre-11.0.18_10-alpine as vfd-run
WORKDIR /opt
RUN apk add --update --no-cache \
bash \
tcpdump \
iperf \
busybox-extras \
iproute2 \
iputils

LABEL maintainder="UDamasceno <udamasceno@ecomp.uefs.br>"
COPY --from=build /opt/target/virtual-fot-device virtual-fot-device
ENTRYPOINT ["./virtual-fot-device"]
COPY --from=builder /opt/vfd/target/virtual-fot-device-1.0-SNAPSHOT-jar-with-dependencies.jar /opt/device.jar
ENTRYPOINT ["java", "-jar", "device.jar"]

2 changes: 1 addition & 1 deletion pom.xml
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@
<dependency>
<groupId>com.github.UellingtonDamasceno</groupId>
<artifactId>extended-tatu-wrapper</artifactId>
<version>main-SNAPSHOT</version>
<version>latest</version>
</dependency>
<dependency>
<groupId>org.projectlombok</groupId>
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@

import extended.tatu.wrapper.model.TATUMessage;
import extended.tatu.wrapper.util.TATUWrapper;
import java.util.Arrays;
import java.util.logging.Level;
import java.util.logging.Logger;
import org.eclipse.paho.client.mqttv3.MqttException;
Expand Down Expand Up @@ -98,6 +99,9 @@ public void deliveryComplete(IMqttDeliveryToken imdt) {
MqttMessage deliveredMessage;
try {
deliveredMessage = imdt.getMessage();
if(deliveredMessage.getPayload().length == 0){
return;
}
String messageContent = new String(deliveredMessage.getPayload());
long customTimestamp = TATUWrapper.getMessageTimestamp(messageContent);
if(customTimestamp == 0){
Expand Down

0 comments on commit d2e155f

Please sign in to comment.